Corrected kdaterange month and year display and removed font-family #406
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.
Description
This PR fixes the incorrect display of the Month Year on the
KDateRange
calendar when the previous month is December of last year and the current month is January. Previously, the left side of the calendar was incorrectly set to December of this year and the right side of the calendar was set to January of next year.The
font-family
declaration has also been removed fromKDateCalendar
as it was unnecessary and caused implementation issues whenKDateRange
is used in Kolibri.Added
predictableActionArguments: true
to xstate validation machine to fix console warning based on XState Docs recommendations found here.Issue addressed
Fixes #405
Before/after screenshots
Before, incorrect Month Year display

After, correct Month Year display

Steps to test
(optional) Implementation notes
At a high level, how did you implement this?
The
activeMonth
(the month that is displayed on the left side of the calendar) is set withnew Date().getMonth() - 1
.When
new Date().getMonth()
returns0
for January, the value returned fromnew Date().getMonth() - 1
is-1
however, it should be11
, for December. Now ifnew Date().getMonth() - 1
returns-1
,activeMonth
is instead set to11
.In
created()
, ifactiveMonth
is11
,activeYearStart
is set to last year.Does this introduce any tech-debt items?
Testing checklist
changelog
Reviewer guidance
Comments
I'm not sure if this change needs to be added in the
changelog
or not.