mde / timezone-js

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

Out-of-the-box Node.js support #139

Closed 9point6 closed 10 years ago

9point6 commented 10 years ago

Is there any reason why the built in transport doesn't include a case for if the library is running on node JS (defaulting to something like the function used in the tests)?

I realise it's trivial to override the function, but it seems odd to require that kind of boilerplate if a developer wants to use the library in a node project

longlho commented 10 years ago

It was originally designed to work in browsers (comes w/ some shims, lazy loading data selectively...). For NodeJS some assumptions might change but overall I don't think there's a concrete reason to not bundle NodeJS transport layer in (other than having to put in browser vs server check & whatnot).

Feel free to submit a PR, unless @mde has other thoughts?

9point6 commented 10 years ago

see pull request above.

look good?

longlho commented 10 years ago

tests please :)?

9point6 commented 10 years ago

Ah, merged already!

I wrote a test, anyway.

mde commented 10 years ago

Let's get that test in there!

longlho commented 10 years ago

yeah I made a commit on top of @9point6's commit to test it, but the more tests the better :)