prantlf / date-fns-timezone

Parsing and formatting date strings using IANA time zones for date-fns.
MIT License
137 stars 18 forks source link

Plans for date-fns v2? #4

Open motin opened 5 years ago

motin commented 5 years ago

Great job in making it possible to work with timezones using date-fns v1! How well does this work with date-fns v2 alpha currently? Will this library live on after v2 release or deprecated once v2 is available and https://github.com/date-fns/date-fns/pull/707 is merged? Or will you port your changes to a new PR for v2?

prantlf commented 5 years ago

Thanks for the warn words, @motin! I use only public interface of parse and format; it will depend on if v2 breaks it or not. I should like to have a look it.

I intend to maintain this library for both v1 and v2. v2, once I get my hands on it :-) I'll consider opening a PR for date-fns.

https://github.com/date-fns/date-fns/pull/707 takes a different approach - it uses the native Intl API. You need a modern browser with its support, or a Node.js build with the full ICU (or the full-icu-data module) if you use it.

I integrated timezone-support, which uses the time zone data from a JavaScript module; either a bundled one or a custom one. It is more flexible, than the native API, but it is customizable and running everywhere today.

stevensacks commented 4 years ago

V2 is out now and its format function has changed quite a bit, but I'm not sure if it causes breaking changes for this library. I haven't noticed any issues with formatToTimeZone yet but I'm only using it at its most basic thus far.

ngehlert commented 4 years ago

any updates on this? is v2 support planned? do you need any help? or is this project done?

jkeen commented 4 years ago

I'm still on date-fns 1.x because of this compatibility uncertainty.

osdiab commented 4 years ago

Looks like this project is unmaintained? no activity for a year

ngehlert commented 4 years ago

looks like it. I recently upgraded to date-fns 2x in a project and just extracted and build the stuff I needed by myself... :(

jkeen commented 3 years ago

@ngehlert Got anything you can PR?

jkeen commented 3 years ago

Wait wait wait, did v2 make this library unnecessary? https://date-fns.org/v2.16.1/docs/Time-Zones

erikt9 commented 3 years ago

@jkeen That library requires the browser to support parts of Intl that IE lacks. This library works with IE.

jkeen commented 3 years ago

@erikt9 Ahh is that all? That helps me out, because my app doesn't support IE. Thanks!