Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clarifying date-fns compatibility #7

Open
fturmel opened this issue Apr 8, 2024 · 2 comments
Open

Clarifying date-fns compatibility #7

fturmel opened this issue Apr 8, 2024 · 2 comments

Comments

@fturmel
Copy link
Member

fturmel commented Apr 8, 2024

While helping with date-fns/date-fns#3755, I realized it's not particularly clearly stated that this package is meant to be used with date-fns v3 and won't work as expected with <= 2.

It would be helpful to add peerDependencies/peerDependenciesMeta fields to the package.json, and a note on compatibility in the readme.md.

Maybe also update the date-fns docs on time zones to give an overview of the package.

@kenlyon
Copy link

kenlyon commented Apr 16, 2024

This bug report was helpful for me. Thanks for logging it!

I was trying to work out how this was meant to work because the date-fns source code I was stepping through was converting all my UTCDate inputs to regular Date objects. I was using v2 of date-fns.

It's working as intended after upgrading to 3.6.0 because the cloning logic now uses the constructor of the supplied object, preserving the UTCDate.

@JonathonRP
Copy link

main trying to do this with so little documentation is hard, even using 3.6.0... it doesn't stay utc from server to client... maybe should just use date-fns-tz...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants