summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOleg Yadrov <oleg.yadrov@qt.io>2016-10-27 14:02:39 -0700
committerOleg Yadrov <oleg.yadrov@qt.io>2016-11-01 19:22:49 +0000
commit094ad30c94a72784449f43ef06d2172d644ab0fd (patch)
tree4f46442a1d3f07eed374fb3e734304098c3276c4
parent768f70e05ff4d8521f439d1e9410750bdf98b584 (diff)
downloadqtquickcontrols-094ad30c94a72784449f43ef06d2172d644ab0fd.tar.gz
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 <edward.welbourne@qt.io> Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
-rw-r--r--src/controls/Calendar.qml4
1 files changed, 3 insertions, 1 deletions
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)