fix(Calendar): sometimes first day of next month is missing #1236
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Solves #1213.
This was solved by me in unovue/radix-vue#1029 but @epr3 suggest you might also need this fix.
Root cause: when 6th week will start in new month then
startFrom
will beundefined
. Currentlyif (!startFrom)
was using first day of next month, but then in creation of extraDaysArray all dates were incremented which resulted in first day of new month being missed.I am not familliar with Svelte so I do not have any test case for this. But you might want to cross check with how it might be tested in radix-vue: https://github.com/radix-vue/radix-vue/pull/1029/files#diff-a067dd33cc3ddceb2d881b1d1984509071d713079564a97d9ea182084284e2f8
At least using August 2024 instead of January 1980 might help if you are into this, but my conclusion is it most probably will not be worth it, especially from performance perspective.