We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Describe the bug If the year component of a date is less than 1000, the leading zeroes are omitted when trying to format the year with 'YYYY'.
'YYYY'
E.g.:
dayjs(Date.parse('0001-01-01')).format('YYYY-MM-DD') //=> '1-01-01' dayjs(Date.parse('0010-01-01')).format('YYYY-MM-DD') //=> '10-01-01' dayjs(Date.parse('0100-01-01')).format('YYYY-MM-DD') //=> '100-01-01'
Expected behavior 'YYYY' in the format string should place leading zeroes to make sure the year takes up 4 digits in the output.
dayjs(Date.parse('0001-01-01')).format('YYYY-MM-DD') //=> '0001-01-01' dayjs(Date.parse('0010-01-01')).format('YYYY-MM-DD') //=> '0010-01-01' dayjs(Date.parse('0100-01-01')).format('YYYY-MM-DD') //=> '0100-01-01'
Information
The text was updated successfully, but these errors were encountered:
Add missing padding to 'YYYY' format
37dbef2
Adds padding to the year component when formatted with `'YYYY'`, similar to how padding is handled for '`MM`' and '`DD`'. Fixes iamkun#2230
🎉 This issue has been resolved in version 1.11.8 🎉
The release is available on:
Your semantic-release bot 📦🚀
Sorry, something went wrong.
Successfully merging a pull request may close this issue.
Describe the bug
If the year component of a date is less than 1000, the leading zeroes are omitted when trying to format the year with
'YYYY'
.E.g.:
Expected behavior
'YYYY'
in the format string should place leading zeroes to make sure the year takes up 4 digits in the output.E.g.:
Information
The text was updated successfully, but these errors were encountered: