-
Notifications
You must be signed in to change notification settings - Fork 426
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
fix: issue with the US formatting used by formatRelative when no locale defined #7798
Conversation
…le is passed is resolved
The latest updates on your projects. Learn more about Vercel for Git ↗︎
1 Skipped Deployment
|
{!isPublishedPerspective(release) && isReleaseScheduledOrScheduling(release) && ( | ||
<Box padding={2}> | ||
<Text size={1}> | ||
<LockIcon /> |
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.
Lock now shows for scheduled releases
@@ -169,10 +174,10 @@ export const GlobalPerspectiveMenuItem = forwardRef< | |||
{displayTitle} | |||
</Text> | |||
{!isPublishedPerspective(release) && | |||
release.metadata.releaseType !== 'undecided' && | |||
release.metadata.releaseType === 'scheduled' && |
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.
Improvement to handle case that intendedPublishAt
has not been updated when release type is (which shouldn't happen in studio, but could if CLI/API is used directly)
No changes to documentation |
Component Testing Report Updated Nov 12, 2024 2:38 PM (UTC) ❌ Failed Tests (1) -- expand for details
|
⚡️ Editor Performance ReportUpdated Tue, 12 Nov 2024 14:41:00 GMT
Detailed information🏠 Reference resultThe performance result of
🧪 Experiment resultThe performance result of this branch
📚 Glossary
|
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.
Thanks for this Jordan, this is great :)
Description
Currently:
For dates more than a week in the past/future, these would be formatted as 'MM/dd/yyyy':
Now:
These dates are formatted correctly according to the locale formatting of the client, eg in my case 'dd/MM/yyyy':
Ideally we would pass through the client locale to
date-fns
however given the way thatdate-fns
requires the locale to be imported, and that the mappings ofnavigator.language
to thedate-fns
are rather specific, taking the approach in this PR felt most extensible to all locales.What to review
Testing
Added tests for the wrapper util
formatRelativeLocale
Notes for release
N/A
N/A