marnusw / date-fns-tz

Complementary library for date-fns v2 adding IANA time zone support
MIT License
1.06k stars 116 forks source link

Version 3 #273

Closed marnusw closed 5 months ago

marnusw commented 6 months ago

Closes #260 Closes #266 Closes #268

nikensss commented 6 months ago

Hi, @marnusw! If there's anything you would like some help with regarding the action list in the PR description let me know, maybe I can help.

marnusw commented 6 months ago

@nikensss thank you for the offer. I wanted to match what date-fns did for v3 as far as possible, but I realised the work I've done up to this point probably covers it, and the remainder can be done as interntal changes after the major version change.

I've published 3.0.0-beta4 this morning without really testing it thoroughly. What would help, if you do have some time, is to test this beta please to see if it functions as expected. If so, I think it might be ready for the v3 release.

dartess commented 6 months ago

I tried 3.0.0-beta4, and so far I can’t run my tests with vitest:

Error: Directory import '.../node_modules/date-fns-tz/esm/format' is not supported resolving ES modules imported from .../node_modules/date-fns-tz/esm/formatInTimeZone/index.js
⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯
Serialized Error: { code: 'ERR_UNSUPPORTED_DIR_IMPORT', url: 'file:///.../node_modules/date-fns-tz/esm/format' }

maybe it's not the lib's problem, but 3.0.0-beta.3 works fine

fbellomi commented 6 months ago

beta.4 also fails for me, where beta.3 is fine

RollupError: src/js/realtime.jsx (29:26): "utcToZonedTime" is not exported by "node_modules/date-fns-tz/esm/index.js", imported by "src/js/realtime.jsx".
file: /Users/francesco/Library/CloudStorage/Dropbox/Projects/ServiceOptions/SerOpt-UI/src/js/realtime.jsx:29:26
gustavopch commented 6 months ago

@fbellomi Possibly because of this?

  • [x] Rename utcToZonedTime to toZonedTime to make it less confusing (comments welcome!)
fbellomi commented 6 months ago

@gustavopch you're definitely right! --thanks

samuelcole commented 6 months ago

I tried 3.0.0-beta4, and so far I can’t run my tests with vitest:

Error: Directory import '.../node_modules/date-fns-tz/esm/format' is not supported resolving ES modules imported from .../node_modules/date-fns-tz/esm/formatInTimeZone/index.js
⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯
Serialized Error: { code: 'ERR_UNSUPPORTED_DIR_IMPORT', url: 'file:///.../node_modules/date-fns-tz/esm/format' }

maybe it's not the lib's problem, but 3.0.0-beta.3 works fine

this is happening to me as well, i'm running nextjs if that helps

marnusw commented 6 months ago

ESM imports should be fixed in 3.0.0-beta.6.

dartess commented 5 months ago

3.0.0-beta.6 works good

mnigh commented 5 months ago

@marnusw any idea why some of the checks are not running? maybe missing some credentials? i don't see either Los_Angeles or Melbourne (only America/Los_Angeles and Australia/Melbourne) in the yml file.

Writing SSH key for checkout to "/home/circleci/.ssh/id_rsa"
Writing SSH public key for checkout to "/home/circleci/.ssh/id_rsa.pub"
Cloning git repository
Cloning into '.'...
git@github.com: Permission denied (publickey).
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
error running git clone "git@github.com:marnusw/date-fns-tz.git": exit status 128

Screenshot

Screen Shot 2024-04-05 at 09 02 25
marnusw commented 5 months ago

@mnigh I've been meaning to sort it out once v3 is live. I recently reauthorized CircleCI which then correctly started running the three checks that pass, but the other two are old ones which seem to still link to the old, now non-existent, CircleCI account and get triggered for new commits but then fail. I expect I will need to reach out to CircleCI support to get it resolved.

samuelcole commented 5 months ago

3.0.0-beta.6 works good

i've been clicking around my app, and beta 6 is working perfectly for us!

jgravois commented 5 months ago

3.0.0-beta.6 is working well in our app too. thanks for tackling this upgrade 🙏