debugpolitics / debugpolitics.github.io

www.debugpolitics.com
26 stars 4 forks source link

[FINAL] Feature/countdown #17

Closed MiguelCarranza closed 7 years ago

MiguelCarranza commented 7 years ago

screen shot 2016-12-08 at 11 44 54 pm

Basic countdown clock. Parameters (GET):

MiguelCarranza commented 7 years ago

Style can be changed. Also, forgive my rusty JS.

avand commented 7 years ago

What time zone is timestamp in. UTC I suspect?

MiguelCarranza commented 7 years ago

@avand no, it's all based in local. I should probably improve that, I just went for the simplest approach. But you're right, that can cause many headaches

avand commented 7 years ago

Local is fine! No problem there.

avand commented 7 years ago

Was just wondering if we could pass some simple date format like 2016-12-11-1700. That would be a bit an improvement worth making.

MiguelCarranza commented 7 years ago

I was going to build another website with a datepicker that would redirect to this guy with the right params... but I guess this suffices

avand commented 7 years ago

Can you just link to that site (in a new window) on the countdown page in the event a to param is not supplied? That would make it easy to at least click through, get the epoch time, and come back.

MiguelCarranza commented 7 years ago

@avand doing something like Date.parse('2016-12-09 07:52:01) was my first idea, but its behavior is not consistent. It seems to only work fine on Chrome, unless using RFC2822, which I guess is as confusing as passing a timestamp. I'll figure out something tomorrow in the morning.

MiguelCarranza commented 7 years ago

@avand screen shot 2016-12-09 at 11 18 56 am