You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
LocalDateRange Shift/Expand by months move the closed last day, so Month(2026,2).Shift(P1M) is not March #223
area/rangesRange unions, variants and the shape enginesbugSomething isn't workingpackage/coreAffects CodoMetis.ValueRangespackage/nodatimeAffects CodoMetis.ValueRanges.NodaTimeseverity/mediumInconsistency or failure in a narrow scenariosilentAnswers wrongly without throwing — fixes go in the next major, never deferred
LocalDateRange.Shift and Expand by a Period of months move the closed last day, so a month does not shift to the next month:
LocalDateRange.Month(2026, 2).Shift(Period.FromMonths(1)) is [2026-03-01,2026-03-28], not Month(2026, 3).
Quarter(2026, 3).Shift(P3M) ends on 30 December.
Month(2026, 2).Expand(P1M) is [2026-01-01,2026-03-28].
The sibling LocalDateTimeRange [2026-02-01,2026-03-01).Shift(P1M) is [2026-03-01,2026-04-01), and PostgreSQL's own arithmetic on the daterange[2026-02-01,2026-03-01) gives [2026-03-01,2026-04-01). Claim R31 names both types in one sentence, yet they disagree on the same month. The calendar factories (#48) ship in the same release, so Month(...).Shift(P1M) is the obvious call to write. Found by the pre-tag analysis (#179) at LocalDateRange.cs:527,541. The same rule probably applies to DateRange and YearMonthRange with any month-based step; check every closed-end date type.
Decision (maintainer, 2026-10-18)
Shift the exclusive end (the day after the last day), then step back one day. That gives Month(y, m).Shift(P1M) == Month(y, m + 1), the same as LocalDateTimeRange and PostgreSQL. 10.0.0 hasn't shipped, so this changes nothing anyone has received.
Done when
R31 and docs/ranges.md describe the new rule.
A test holds Month(y, m).Shift(P1M) == Month(next) and Quarter(...).Shift(P3M) == Quarter(next) for every month of a leap and a non-leap year, and an Expand case.
area/rangesRange unions, variants and the shape enginesbugSomething isn't workingpackage/coreAffects CodoMetis.ValueRangespackage/nodatimeAffects CodoMetis.ValueRanges.NodaTimeseverity/mediumInconsistency or failure in a narrow scenariosilentAnswers wrongly without throwing — fixes go in the next major, never deferred
Activity