Datepicker overflow when setting date to the 31st of a month.
@sashamilenkovic is already working on this.
Since Jun 17, 2024.
Assessment
This issue has not been assessed yet.
Description
Reproduction
https://formkit.link/1d9a21fdf2fdc215a426c75ef6085408
Describe the bug
When a datepicker has an initial value set either by a v-model or the value attribute, programmatically setting the day to the 31st of a month overflows the year value to 1904 and sets the day to the 3rd (E.g. Dec 31, 2024 turns to Dec 3, 1904). It runs into no issues when setting to the 30th of a month, only the 31st. However, setting the date a second time will fix the issue and set it correctly in the field.
This issue occurs whether the v-model has been changed or if the node input is changed. This also occurs on Firefox, Edge, and Chrome. I have not tested any other browsers. This also only occurs with months that have 31 days. Months with less than 31 days do not seem to run into this issue. Along with that, it does not occur if there is no initial date provided to the field.
I was able to reproduce the issue in the sandbox. Simply click the buttons to change the date. When clicking the buttons twice, the date will fix itself. My timezone is CST if that matters for native JS Date reasons.
Environment
• OS: Windows 11
• Browser Firefox
• Version 1.6.5 and 0.126.11
- Dominant language
- TypeScript
- Stars
- 4.8k
- Forks
- 208
- PR merge metrics
- No merged PRs in 30d
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from formkit/formkit
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
-
🐛 bug 🔎 reproduction-needed Pro
Difficulty 1/5 Under an hour Newbie friendliness 72/100
-
Difficulty 3/5 1-2 days Newbie friendliness 64/100
-
Difficulty 3/5 1-2 days Newbie friendliness 55/100
-
⛑ Needs triage 🐛 bug-report
Difficulty 3/5 1-2 days Newbie friendliness 55/100
Similar issues
-
Browser Waiting for: Product Owner
Difficulty 2/5 1-3 hours Newbie friendliness 85/100
getsentry/sentry-javascript#24577 · 1 comment ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
agilepathway/label-checker#640 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
copse-dev/agent-pane#2953 ·
-
agentic-workflows
Difficulty 1/5 Under an hour Newbie friendliness 85/100
githubnext/rig#534 ·
-
automation missing-model model-sync provider:pioneer
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
anomalyco/models.dev#7701 ·