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

Netlify app: format pattern "a..aa" returns "AM..AM" #5081

Closed
benomatis opened this issue Oct 7, 2023 · 1 comment
Closed

Netlify app: format pattern "a..aa" returns "AM..AM" #5081

benomatis opened this issue Oct 7, 2023 · 1 comment

Comments

@benomatis
Copy link
Contributor

benomatis commented Oct 7, 2023

In date-fns v2.28.0, despite what's indicated in the format patterns list of the documentation, the format pattern a..aa returns AM..AM instead of just AM. It looks like using simply a is what returns AM.

I reported this on date-fns but you might want to correct it here to use a not having to wait for date-fns to fix it - not sure if that's the right approach: date-fns/date-fns#3539

return `${formatDistanceToNow(d)} ago at ${format(d, 'h:mm:ss a..aa')}`;

image
benomatis added a commit to benomatis/apps that referenced this issue Oct 7, 2023
Replace date-fns format pattern `a..aa` with `a`

Fixes contentful#5081
@benomatis
Copy link
Contributor Author

benomatis commented Oct 13, 2023

This is a misunderstanding of the doc: "a..aa" is a notation meant to say "a" till "aa" (ie. either "a", or "aa").

Now date-fns have a PR suggesting a correction to their doc.

@benomatis benomatis reopened this Oct 13, 2023
whitelisab pushed a commit that referenced this issue Dec 28, 2023
Replace date-fns format pattern `a..aa` with `a`

Fixes #5081
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 a pull request may close this issue.

1 participant