Skip to content

Conversation

@RickCarletti
Copy link

The diff function in date_utils was calculating differences incorrectly when the scale was set to month or year.
This caused items to be displayed in the wrong month when switching the view_mode to month or year.

Example of the issue

  • Input: 2025-10-01
  • Displayed as: 2025-09-01

Changes

  • Replaced the previous month/year calculation (which used an approximation of 30 days per month).
  • Implemented a new diffInMonths function that:
    • Ensures correct handling of which date is greater.
    • Calculates exact whole months between dates.
    • Anchors the calculation on the real calendar month length.
    • Computes the fractional month based on actual month duration.

✅ With this fix, month and year differences are now calculated accurately and items display in the correct position.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant