Skip to content

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

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

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.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant