From 7ee4003840c02b423399004860a2c583d327cc22 Mon Sep 17 00:00:00 2001 From: daboe01 Date: Sun, 1 Feb 2026 19:29:59 +0100 Subject: [PATCH] fixed: prevent timezone shift from reverting month navigation in _CPDatePickerCalendar --- AppKit/CPDatePicker/_CPDatePickerCalendar.j | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/AppKit/CPDatePicker/_CPDatePickerCalendar.j b/AppKit/CPDatePicker/_CPDatePickerCalendar.j index af43569b3..101185add 100644 --- a/AppKit/CPDatePicker/_CPDatePickerCalendar.j +++ b/AppKit/CPDatePicker/_CPDatePickerCalendar.j @@ -251,7 +251,15 @@ - (void)_displayNextMonth { - [self setDateValue:[_monthView nextMonth]]; + // Copy the date so we don't modify the view's state directly + var nextDate = [[_monthView nextMonth] copy]; + + // Set to the middle of the month (15th). + // This prevents [setDateValue:]'s timezone adjustment from + // shifting the date back into the previous month (e.g., Nov 1 -> Oct 31). + nextDate.setDate(15); + + [self setDateValue:nextDate]; } - (void)_displayPreviousMonth