nicola / isawake

:sunrise: The (eventually) biggest crowdsourced database of people awake, sign up with a pull-request
http://isawake.me
27 stars 25 forks source link

Implement DST #13

Open koalalorenzo opened 10 years ago

koalalorenzo commented 10 years ago

I live in Copenhagen (UTC+1) but the time zone should be DST+1. It would be nice to use the DST time zones too. :+1:

http://en.wikipedia.org/wiki/Daylight_saving_time

nicola commented 10 years ago

I think we just need:

koalalorenzo commented 10 years ago

There are some countries that do not use DST! So it should be something like this:

{
     'offset': +1,
     'range': [8, 1],
     'DST': true
}

In this way who is living in a country that does not "have" DST, can just disable it.

nicola commented 10 years ago

but this adds a complexity. Unless we ask them what city they are in, so that we can calculate that everytime. Momentjs? :)

koalalorenzo commented 10 years ago

Yes! Momentjs is a good solution! It has the perfect time zone integration... do you know any other library that could be integrated to fix this problem?

framp commented 10 years ago

momentjs.com/timezone/

Look pretty easy - and provide a better experience for the user

nicola commented 10 years ago

Do we then want to ask users for their city?

nicola commented 10 years ago

Ok this is the only solution. I am fine with this. Refactoring now