-
Notifications
You must be signed in to change notification settings - Fork 8
feat: granular number and date formatting options for tags #741
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: master
Are you sure you want to change the base?
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
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.
Pull Request Overview
This PR adds granular formatting options for number and date values in tags by introducing support for Intl.NumberFormat and Intl.DateTimeFormat options through HTML attributes.
- Adds 38 new formatting attribute constants to support all Intl formatting options
- Refactors tag value formatting logic to use a dedicated formatValue function with comprehensive options
- Implements fallback error handling for locale formatting failures
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 6 comments.
| File | Description |
|---|---|
| packages/list/src/utils/constants.ts | Defines new formatting attribute constants for number and date formatting options |
| packages/list/src/filter/tags.ts | Refactors formatting logic to support granular options and adds error handling |
| .changeset/fast-onions-march.md | Documents the feature addition as a minor version change |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
Enables granular formatting of number and date values in the tags.
Any tag value that has a
fs-list-formatdisplayattribute, can now also opt into all these attributes, which match the Intl.NumberFormat options for numbers and the Intl.DateTimeFormat() options:fs-list-formatdisplayfs-list-formatcompactdisplayfs-list-formatcurrencyfs-list-formatcurrencydisplayfs-list-formatcurrencysignfs-list-formatcalendarfs-list-formatdatestylefs-list-formatdayfs-list-formatdayperiodfs-list-formaterafs-list-formatformatmatcherfs-list-formatfractionalseconddigitsfs-list-formathourfs-list-formathour12fs-list-formathourcyclefs-list-formatlocalematcherfs-list-formatminutefs-list-formatmonthfs-list-formatmaximumsignificantdigitsfs-list-formatmaximumfractiondigitsfs-list-formatminimumfractiondigitsfs-list-formatminimumintegerdigitsfs-list-formatminimumsignificantdigitsfs-list-formatnotationfs-list-formatnumberingsystemfs-list-formatroundingpriorityfs-list-formatroundingincrementfs-list-formatroundingmodefs-list-formatsecondfs-list-formatsigndisplayfs-list-formatstylefs-list-formattimestylefs-list-formattimezonefs-list-formattimezonenamefs-list-formattrailingzerodisplayfs-list-formatunitfs-list-formatunitdisplayfs-list-formatusegroupingfs-list-formatweekdayfs-list-formatyear