fix(useDateFormat): Error if Y or YYY provided #3001
Analysis complete
Summary
Fixed a bug in useDateFormat
that caused undefined output when using custom strings with non-format characters. Improved the error handling of invalid format tokens.
Walkthrough
- Fix the
formatDate
function to handle non-format tokens in the input string (link)
Poem
formatDate
fixed
Custom strings do not break now
Autumn bug squashed
Emoji
🐛🛠️📝
Include these descriptions in your pull request description by including the following marker tags:
copilot:all
: all the content, in one gocopilot:summary
: a one paragraph summary of the code changescopilot:walkthrough
: a step by step walkthrough of the code changescopilot:poem
: a poem about the code changes!copilot:emoji
: three emoji that capture the changes
Feedback is welcome. Simply add a comment to this PR of the form /copilot feedback [your comments here]
.
Details
Copilot for PRs is a limited technical preview from GitHub Next.
It's aim is to make it easier to write pull request descriptions by providing automatically generated suggestions based on the code changes.
To find out more go to https://githubnext.com/projects/copilot-for-pull-requests or come and chat with us on Discord
File | Status | Duration |
---|---|---|
Summary & Walkthrough | ✅ Finished | 11.8 seconds |
packages/shared/useDateFormat/index.ts | ✅ Finished | 6.4 seconds |