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

feat: Add format.dateTimeRange #769

Merged
merged 6 commits into from
Feb 19, 2024

Conversation

martinmunillas
Copy link
Contributor

@martinmunillas martinmunillas commented Jan 10, 2024

Contributes to #774

Add support for Intl.DateTimeFormat.prototype.formatRange()

Copy link

vercel bot commented Jan 10, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
next-intl-docs ✅ Ready (Inspect) Visit Preview 💬 Add feedback Feb 19, 2024 8:55am
next-intl-example-app-router ✅ Ready (Inspect) Visit Preview 💬 Add feedback Feb 19, 2024 8:55am

Copy link

vercel bot commented Jan 10, 2024

@martinmunillas is attempting to deploy a commit to the next-intl Team on Vercel.

A member of the Team first needs to authorize it.

Copy link
Owner

@amannn amannn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the great PR! I think this is a good idea.

There was related discussion about number range formatting in #540. I've now added #774 to get an overview about the formatting APIs from Intl that next-intl currently supports.

packages/use-intl/src/core/createFormatter.tsx Outdated Show resolved Hide resolved
packages/use-intl/test/core/createFormatter.test.tsx Outdated Show resolved Hide resolved
packages/use-intl/src/core/createFormatter.tsx Outdated Show resolved Hide resolved
@martinmunillas
Copy link
Contributor Author

sorry I haven't looked back at this pr

@martinmunillas
Copy link
Contributor Author

hey @amannn sorry for the delay, I had this in my to dos but I haven't had the time, I tackled all the comments you made, please feel free to give it another review, also feel free to update this pr if you think it would be easier/quicker than for me to look back at this(given that you know the codebase better and know your requirements for something to get merged)

 - Allow to override the time zone per invocation
 - Docs: Mention capability to reference formats by name, specify custom anchors, more compact formatting in example
 - Bump sizes
Copy link
Owner

@amannn amannn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks a lot for adding the docs and centralizing the time zone!

I did a final review and cleaned up a few minor things along the way, but looks really good to me now!

Many thanks for this @martinmunillas! 🙌

@amannn amannn changed the title feat: add date range format support feat: Add format.dateTimeRange Feb 19, 2024
@amannn amannn merged commit 9f12521 into amannn:main Feb 19, 2024
6 checks passed
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

Successfully merging this pull request may close these issues.

None yet

2 participants