Better Parenting Time Exchanges with TRMNL

A couple of weeks ago I received my TRMNL order, and TRMNL promptly held a perfectly-timed hackathon for calendar-based plugins, lighting the proverbial fire under my behind to get me to write a plugin to show my kids how long until they go to their other parent’s house, and to give me a countdown until they’re back. While I didn’t win the hackathon, (check out the winners, they’re great), I continue to use and improve my little plugin with the goal of eventually turning it into a public recipe. I am certain there are plenty of parents out there in the same situation that I am, or who simply want to count down to other recurring calendar events.

A screenshot of the TRMNL device showing my private countdown plugin full screen.
This is what the full-screen version of my Calendar Countdown plugin looks like.

Things to Know When Coding for TRMNL

Debug JavaScript Right In Your Browser

TRMNL’s web-based coding environment is a bit weird, but it runs Javascript in the browser, which means that console.log statements appear in your browser’s dev tools.

Watch Out for the Time Zone!

When dealing with Date/Time in Javascript, the device’s timezone might not match your timezone. The user timezone data that supplied in the trmnl.user data should be used to set the appropriate timezone.

Events Not in Chronological Order

Sometimes calendar events don’t appear in chronological order in the data feed. I rectify this by running an Array.prototype.sort() on my array of interesting events once I have identified them.

Wishlist to make TRMNL Even Better

More Data Types for Settings

The ability to have a dictionary or object in settings, with a UI to set key-value pairs, would make it easier to have a list of events that are interesting to the plugin.

Improved Story for Local Development

While the online development system works, I would like a more robust system for local development. There is trmnlp, which is supposed to give a local development environment, but I was never able to get it up and running. I suspect that using trmnlp would allow me to put my Javascript into its own file, not have to copy the same Javascript into the HTML of all four of the layouts for my plugin.

What do you think?

Your name and E-mail address, and of course a comment, are required. I won't do anything evil with your E-mail address.

If you so desire, you may use these tags in your comment: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Made by John