Skip to content

Commit

Permalink
fix #1671 wrong calendar day with TZ=America/Mexico_City
Browse files Browse the repository at this point in the history
  • Loading branch information
PeterPetrik committed Oct 5, 2023
1 parent 897285b commit 39bc374
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion app/qml/components/DateTimePicker.qml
Original file line number Diff line number Diff line change
Expand Up @@ -392,7 +392,17 @@ Item {
MouseArea {
anchors.fill: parent
onClicked: {
calendar.selectDate(model.date)
let pickedDate = new Date( model.year, model.month, model.day);
// Do NOT use model.date!!
// see https://bugreports.qt.io/browse/QTBUG-72208
// For some timezones model.date.getDate() != model.day
// e.g. you are in timezone TZ=America/Mexico_City
// model.date: Wed Oct 11 18:00:00 2023 GMT-0600
// model.day: 12
// model.date.getDate(): 11
// pickedDate Fri Oct 12 00:00:00 2023 GMT-0600
// pickedDate.getDate(): 12
calendar.selectDate(pickedDate)
}
}
}
Expand Down

0 comments on commit 39bc374

Please sign in to comment.