From 094ad30c94a72784449f43ef06d2172d644ab0fd Mon Sep 17 00:00:00 2001 From: Oleg Yadrov Date: Thu, 27 Oct 2016 14:02:39 -0700 Subject: Calendar: fix date selection if system time zone is set to DST Date() constructor uses local time. E.g. in Brazil Oct-21-2012 is the start of daylight saving time, thus local dates at Oct-21-2012 between 00:00 and 01:00 do not exist there, so new Date(2012,10,21) returns Oct-20-2012 23:00, but new Date(2012,10,21,1) returns Oct-21-2012 00:00. 1 hour is enough to "jump over" the lost hour, but just in case we use 12. Task-number: QTBUG-54559 Change-Id: I35e1b69868d27dd98f78c4d57b3128a51b3e4b5e Reviewed-by: Edward Welbourne Reviewed-by: Mitch Curtis --- src/controls/Calendar.qml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/controls/Calendar.qml b/src/controls/Calendar.qml index b5dadc0b..fe47b8a3 100644 --- a/src/controls/Calendar.qml +++ b/src/controls/Calendar.qml @@ -215,7 +215,9 @@ Control { */ property CalendarModel __model: CalendarModel { locale: calendar.__locale - visibleDate: new Date(visibleYear, visibleMonth, 1) + + // TODO: don't set the hour when QTBUG-56787 is fixed + visibleDate: new Date(visibleYear, visibleMonth, 1, 12) } style: Settings.styleComponent(Settings.style, "CalendarStyle.qml", calendar) -- cgit v1.2.1