sproutsocial / walltime-js

A JavaScript library for easily translating a UTC time to a "Wall Time" for a particular time zone.
MIT License
121 stars 12 forks source link

Add a --minyear parameter, to truncate obsolte rules/zones #28

Closed adamhooper closed 11 years ago

adamhooper commented 11 years ago

I've added a --minyear option. With it, cake -y 2010 data will build a client/walltime-data.js of 74kb, walltime-data.min.js of 66kb, and gzip-compressed data of 9 kb.

jgable commented 11 years ago

Seems useful, thanks for taking the time to put this together. Let me look over it real quick.

adamhooper commented 11 years ago

By the way: the client/walltime-data.js that I get from a cake data is different from what's already in the repository. But diff is rather unusable, so I can't tell whether it's updated timezone data (which I suspect), a bug in this pull request, a bug somewhere else, or a recent fix.

jgable commented 11 years ago

Ok, I'll merge locally and take a look.

jgable commented 11 years ago

It looks like sometimes the rule.to values are NaN which is causing some skips. Looks like there are some problems with the ranges for Asia/Baku etc.

Still looking into it.

jgable commented 11 years ago

Looks like we were not properly parsing the end dates for zone lines that contained until rules like lastSat.

3:00 RussiaAsia AZ%sT   1992 Sep lastSat 23:00

I've merged in your changes and added some unit tests in a separate commit. Should be in soon.