what time is it?

02 March 2021

There are plenty of apps to display timezones but I made that one. There isn’t really anything revolutionary about it but I made that one. So why did I made it? I’ve been using: worldtimebuddy.com for years, the design is outdated, it is limited to 4 locations, there are noise on the page (social media buttons, help, description) and it doesn’t persist your locations. I figured it would be a good experiment exercise to do instead of looking for an alternative.

First choosing technologies:

  • nextjs and vercel: easy to get started, and fast deployment
  • spacetime to deal with time and timezone. It isn’t as complete as momentjs but it is good enough to show time “now”
  • mapbox to fetch GPS coordinates
  • railway for redis

What is good?

Leveraging URL parameters. In contrast with worldtimebuddy, jetlag is persisting your location choices directly in the URL, so refresh the page: your choices are the same, share the link with a coworker: they are seeing the exact same view as you. I think URLs are underated in webapps. My rules are to know if I should store parameters in the URL:

  1. if I refresh, should the page be the same? yes
  2. if I share the URL with someone, should that someone see the same thing as me?

If the answers is yes to one of these, then you probably want to put your parameter in the URL: hash, query, or path parameter.

It might break down, and depending on session context. I added one special keyword: me (or here) that uses your browser timezone. It was for sack of simplicity but then it breaks rule 2: if I share the link with someone that someone won’t see the same page as me.

What can be better?

  • select a time range
  • autocomplete and select a location. Right now you need to be specific when looking for a city, otherwise it might default to the wrong one such as this example: jetlag.oertel.fr/puerto escondido/puerto escondido, oaxaca. The first is in Brazil and the second in Mexico.
  • better layout, I’m not sold on columns, maybe rows would be better?

Give it a try: jetlag.oertel.fr

Will you find the easter egg? Hint: you must visit the website a certain day of the week