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 ed03bea
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 Thu Oct 12 00:00:00 2023 GMT-0600
// pickedDate.getDate(): 12
calendar.selectDate(pickedDate)
}
}
}
Expand Down

1 comment on commit ed03bea

@inputapp-bot
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

iOS - version 23.10.463311 just submitted!

Please sign in to comment.