From 2c4faa8f3ad52dab71b2326fbd97203d7683f4a9 Mon Sep 17 00:00:00 2001 From: ARAKHNID Date: Sat, 29 Aug 2026 12:03:29 -0500 Subject: [PATCH] date-chooser: Clamp to first day of month when clicking previous/next buttons When clicking the previous/next buttons, the view might not be aligned to the start of the month, which can cause confusion. Clamping the date to the first of the month removes this confusion by being consistent. This also matches the behavior of the previous/next buttons in the main toolbar. Closes #1606 Part-of: --- src/gui/common/gcal-date-chooser.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/gui/common/gcal-date-chooser.c b/src/gui/common/gcal-date-chooser.c index bf789c22..f8700390 100644 --- a/src/gui/common/gcal-date-chooser.c +++ b/src/gui/common/gcal-date-chooser.c @@ -599,6 +599,9 @@ gcal_date_chooser_set_date (GcalView *view, g_date_time_get_ymd (self->date, &y1, &m1, &d1); g_date_time_get_ymd (date, &y2, &m2, &d2); + if (y1 != y2 || m1 != m2) + d2 = 1; + gcal_set_date_time (&self->date, date); if (y1 != y2 || m1 != m2 || d1 != d2)