Skip to content

NaiveWeek Eq trait inaccurate #1686

@Splashling1789

Description

@Splashling1789

The fact that the NaiveWeek Eq trait is derived and not manually implemented leads to inaccuracies when comparing weeks. For example:
A = NaiveWeek {date: 03-04-2025, start: Monday} and B = NaiveWeek {date: 04-04-2025, start: Monday} (In format day-month-year).

A and B are technically the same week. But when comparing it with the derived Eq trait, it will return false, as their dates are not equal.
A manual implementation of Eq, such as comparing the first day of each week A.first_day() == B.first_day() or something similar would resolve this issue and make week comparisons accurate.

This improvement would significantly enhance the reliability of this data type.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions