mde / timezone-js

DEPRECATED: Timezone-enabled JavaScript Date object. Uses Olson zoneinfo files for timezone data.
824 stars 183 forks source link

XDate like usage and formatting: TZDate #43

Closed samlown closed 4 years ago

samlown commented 12 years ago

Over the weekend I hacked together a version of timezone-js with similar usage to XDate with the same formatting and locale support. To make it a bit easier to use and differentiate, I renamed it TZDate.

It's essentially a proof of concept and aims resolve the timezone problems I was having with XDate. It seems to be working well, timezoneJS's awesome timezone support with XDate's nice API and formatting makes things quite a bit easier.

I'm really not sure if this is a direction you would be interested in going in, it certainly isn't very compatible with current timezoneJS setups, but the source code is available here should you want to have a look: https://github.com/samlown/tzdate

Cheers, sam

ryonlife commented 12 years ago

Hey Sam,

I like the work you've done here. Merging XDate and timezone-js makes all the sense in the world.

I was the first to writer a Node preparser for the Olson data, but I did my work in a branch (uber/timezone-js), these guys gave me commit access to the main project, but I slacked off when it came time to getting it merged and another very well done implementation made its way in instead.

I don't want to speak for the true timezone-js guys, but my workload is going to allow a bit of bandwidth these days, so maybe it makes sense for us all to circle up with the XDate guys and see about pulling all of this together.

Where's everybody else at?

Thanks, Ryan McKillen

On Mon, Aug 20, 2012 at 3:22 AM, Sam Lown notifications@github.com wrote:

Over the weekend I hacked together a version of timezone-js with similar usage to XDate with the same formatting and locale support. To make it a bit easier to use and differentiate, I renamed it TZDate.

It's essentially a proof of concept and aims resolve the timezone problems I was having with XDate. It seems to be working well, timezoneJS's awesome timezone support with XDate's nice API and formatting makes things quite a bit easier.

I'm really not sure if this is a direction you would be interested in going in, it certainly isn't very compatible with current timezoneJS setups, but the source code is available here should you want to have a look: https://github.com/samlown/tzdate

Cheers, sam

— Reply to this email directly or view it on GitHubhttps://github.com/mde/timezone-js/issues/43.

— RM

longlho commented 12 years ago

I'd love to explore more on this front but finding myself also very swamped these days >.< Extending this to support similar XDate functionalities makes sense. I'll try to make time to take a look at it!

There're also remaining bugs in the library itself that I wanna square away before looking at extending functionalities. Those bugs are edge cases which are not high priority but they still exist.

longlho commented 12 years ago

With that said if you guys can help out with the bugs that'd be awesome!!!

mde commented 12 years ago

FWIW, the date utilities in the Utilities library for Node were originally written to go hand-in-glove with timezoneJS.Date: https://github.com/mde/utilities/blob/master/lib/date.js There are the usual suspects like strftime and diff/add. I'm not sure how nicely the newer parse will play with timezone-enabled dates, but everything else should be plug-and-play. The important thing here is that if possible, it's good to have utilities that can work with both overridden, special Date objects, and also generic Dates your code might have to accept in other areas of your code.