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

fix: Format YY should never return one-digit years #2847

Open
wants to merge 1 commit into
base: dev
Choose a base branch
from

Conversation

flaviendelangle
Copy link

@flaviendelangle flaviendelangle commented Mar 21, 2025

I noticed this issue while working on https://github.com/mui/mui-x:

console.log(dayjs().set('year', 2009).format('YY')); // 09
console.log(dayjs().set('year', 9).format('YY')); // 9

If padStart is not widely supported enough I can of course implement the same logic manually.

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.

1 participant