Details
-
Bug
-
Resolution: Unresolved
-
P3: Somewhat important
-
None
-
5.11.2
-
None
Description
I was working with the Qt.labs.calendar MonthGrid. When using the delegate I compared the model.day with the model.date.getDate() and they do not match. The onClicked returns the model.date from the current cell that was clicked which is wrong.
Below is example code that compares the two objects.
Labs.MonthGrid{ id: monthGrid Layout.fillWidth: true Layout.fillHeight: true month: model.month year: model.year locale: Qt.locale("en_US") delegate: Column{Label{ horizontalAlignment: Text.AlignHCenter verticalAlignment: Text.AlignVCenter opacity: model.month === monthGrid.month ? 1 : 0.5 text: model.month +"/"+model.day+"/"+model.year } Label{ horizontalAlignment: Text.AlignHCenter verticalAlignment: Text.AlignVCenter opacity: model.month === monthGrid.month ? 1 : 0.5 text: model.date.getMonth()+"/"+model.date.getDate()+"/" +model.date.getYear() } Label{ horizontalAlignment: Text.AlignHCenter verticalAlignment: Text.AlignVCenter text: model.day !== model.date.getDate() ? "Wrong Date":"Correct Date" } } onClicked: { console.log("onClicked date", date) } onPressAndHold: { console.log("onPressAndHold date", date) } onPressed: { console.log("onPressed date", date) } onReleased: { console.log("onReleased date", date) } }
Attached is an image of the test program I was using. It compares the QtQuick.Controls 1.4 Calendar against one made with Qt.labs.calendar
Attachments
Issue Links
- is duplicated by
-
QTBUG-137723 MonthGrid OnClicked Documentation Should Reference Time is Given in UTC 00:00:00 Before Being Converted to Timezone
-
- Reported
-
Gerrit Reviews
For Gerrit Dashboard: QTBUG-72208 | ||||||
---|---|---|---|---|---|---|
# | Subject | Branch | Project | Status | CR | V |
654339,3 | MonthGrid: fix dates being incorrect for certain timezones | dev | qt/qtdeclarative | Status: NEW | 0 | 0 |