Skip to content
This repository was archived by the owner on Oct 13, 2025. It is now read-only.
This repository was archived by the owner on Oct 13, 2025. It is now read-only.

Bug in daysInMonth - wrong startdate when date is a sunday #8

@Paul-Todd

Description

@Paul-Todd

I noticed that when the first weekday is a sunday an extra week is added in front.

The fix is to do a modulus on the daysBefore so if it is a sunday the remainder is zero and zero is subtracted.

date_utils:32 firstToDisplay = first.subtract(new Duration(days: daysBefore % 7));

With this fix the days now align with Microsoft Outlook monthly calendar as well as Google calendar monthly calendar

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions