Fix period tiling

This commit is contained in:
Jon Staab
2026-06-02 15:07:03 -07:00
parent 6b693e11d3
commit 3682d0606d
+7 -1
View File
@@ -567,7 +567,13 @@ impl BillingPeriod {
months += 1;
}
let end = start.checked_add_months(Months::new(1)).unwrap_or(start);
// Derive `end` from the anchor (the next walk boundary), not `start + 1
// month`: month-add clamps to the last valid day, so re-adding from a
// clamped `start` lands short of `anchor + months` and leaves non-tiling
// gap days for day-2931 anchors. `months` is already that next boundary.
let end = anchor_dt
.checked_add_months(Months::new(months))
.unwrap_or(start);
Some(Self {
start: start.timestamp(),