-
-
Notifications
You must be signed in to change notification settings - Fork 2.7k
feat(#4792): add useTemporal #4793
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
base: main
Are you sure you want to change the base?
Conversation
Adds createTemporal and useTemporal functions along with their corresponding ./useTemporal module exports.
I would like to discuss again whether https://github.com/fullcalendar/temporal-polyfill is not the better polyfill? What is your opinion? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We are on hold for introducing new functions, and also that Temporal is still in Stage 3, https://github.com/tc39/proposal-temporal. I think we'd better leave it to community until the propose is land.
My reason was that Firefox is now the first browser to support this natively and I have the hope that the others will soon follow suit. Therefore, my idea was to support this transition with the polyfill. But let’s wait until it has a better native coverage, then the polyfill would be removed and the PR would revise it. What do you think of the procedure? I think everyone hates new date 😅 |
Stage 3 is not stable enough. Once the proposal is landed, I think we can have it in the core package and without the polyfill (polyfill should be something for users to install themselves if needed) |
Great, then I would wait for it and adjust the PR as soon as it has increased the coverage and stability. You are also welcome to ping me if you think it is the right time. Thank you 😊👍 |
Description
Issue: #4792
This PR introduces
useTemporal
, a new composable that provides a reactive wrapper around the modern Temporal API (TC39 proposal) using the@js-temporal/polyfill
package. This implementation addresses the limitations of the legacyDate
object by providing:The implementation includes:
useTemporal()
: Reactive composablecreateTemporal()
: Static utility functionI have:
Additional context
This implementation is particularly focused on:
The demo component showcases real-world usage scenarios including: