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

Test Compatibility with Moment.js #13

Closed mattjohnsonpint closed 11 years ago

mattjohnsonpint commented 11 years ago

There is somewhat of a trend that favors smart libraries over dumb default implementations. WallTime certainly falls into that category. Thank you for your considerable efforts!

Another library that is often used in this space is Moment.js. They are solving a slightly different problem, focusing on parsing and formatting. They do have a side project for working with timezones, but it is not production ready, and has gotten relatively little attention.

It would be absolutely fantastic if WallTime and Moment could "play nice together". It probably will work, but there may be optimizations that can be done to make things easier. I'd love to see some unit tests specifically for this.

Aside - I'm giving a talk on DateTime fundamentals in a couple of months at Desert Code Camp in Phoenix, AZ. I'd love to feature a Moment/WallTime solution for the javascript parts. :)

jgable commented 11 years ago

I like the idea of integrating with Moment.js, but it will mostly require them changing things rather than us implementing anything much differently. Maybe we could

I see a couple places where a straight use of new Date() like here would cause problems in a timezone sensitive situation.

Good luck with your talk, I think you'll find the most challenging part is getting everybody as excited about miscellaneous timezone related nuances as you are. If all else fails, blame Australia for any time zone related issues. `Murica.

mattjohnsonpint commented 11 years ago

Tim Wood, author of moment.js, is working on a similar library called "moment-timezone", so I think that this item can be closed.