slavaaaaaaaaaa / whattimeisitrightmeow

Would you look at the time!
http://smaslennikov.com/whattimeisitrightmeow
MIT License
48 stars 5 forks source link

Timezone #1

Closed janboll closed 7 years ago

janboll commented 7 years ago

I really like your clock, could you add timezone selection? I am based in Berlin timezone and this is quite confusing.

versable commented 7 years ago

The bash script simply takes the output from the command date +"%H %M", so setting your server/systems timezone will suffice.

slavaaaaaaaaaa commented 7 years ago

@janboll yeah, if you fork it, it'll stick to your timezone.

I think someone somewhere suggested having a branch for each timezone (won't work, GH pages only supports showing one branch).

Another solution is having a fork for each timezone. Clearly we'd need a wrapper for github to implement this. BRB more bash incoming

versable commented 7 years ago

@smaslennikov This could be resolved by dumping the UTC time on a data attribute <p data-time="UTC"></p> and using the ECMAScript Date Object with the method toLocalString. But that would, of course, break the simplicity by adding another language and the compatibility.

Another Solution would be a table of sorts for all timezones.

neuhaus commented 7 years ago

We should loadbalance the server using geoip on the DNS that way we can also take care of this issue!

janboll commented 7 years ago

Could also parallel generate different HTMLs for different timezones and let Nginx decides which html to serve based on the IP. Someone already figured the necessary GeoIP-timezone LUA stuff out: https://github.com/fcambus/telize

ehuggett commented 7 years ago

We could provide links to documentation on how to emigrate to the same timezone as the current clock?

slavaaaaaaaaaa commented 7 years ago

Fixed with https://github.com/smaslennikov/whattimeisitrightmeow/commit/0283287392b23ac26f7315a50048631d747575b2 . If you guys had a more elaborate solution you'd like implemented, feel free to reopen!