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

Develop a shim for the Temporal proposal, exposing a Moment-like interface #1

Open
ptomato opened this issue Jan 2, 2023 · 2 comments

Comments

@ptomato
Copy link
Contributor

ptomato commented Jan 2, 2023

Originally from tc39/proposal-temporal#104

Temporal subsumes most of the functionality of Moment.js, but there's a ton of code out there using Moment, and it will take a long time to upgrade to the Temporal API. To make the transition easier, while reducing download size, it'd be great to have an implementation of most of the Moment API in terms of Temporal, if this is possible. Same for Luxon or date-fns.

Link to some experimentation with date-fns: https://github.com/ptomato/temporal-fns/commits/port-to-temporal

@fabon-f
Copy link

fabon-f commented Mar 11, 2024

I'm developing vremel, date utility library for Temporal API (which is heavily inspired by date-fns). It's not a shim and its target is not a compatibility with date-fns, functions accept and return Temporal objects, but most functions behave similarly. So I think migration from date-fns itself will not be so hard.

But I feel that paradigm shift from legacy Date to Temporal API can be very tough for many developers, especially when they deal with an existing large codebase.

@ptomato
Copy link
Contributor Author

ptomato commented Mar 11, 2024

That's great! I will follow that repo.

Would you like to make a PR for the tc39/proposal-temporal README mentioning it?

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

2 participants