Details
-
Bug
-
Resolution: Invalid
-
P2: Important
-
None
-
5.0.2
-
None
Description
Negative dates in C++ are always one year further into the future when converted to JavaScript.
QML from the attached project:
import QtQuick 2.0 import test 1.0 Item { id: root QuickDate { Component.onCompleted: { console.log(" actual date = " + date); console.log("expected date = " + new Date(-2000, 0, 1)); } } }
Output:
actual date = Mon Jan 01 -1999 00:00:00 GMT+0100 (CET)
expected date = Sat Jan 01 -2000 00:00:00 GMT+0100 (CET)
Attachments
Issue Links
- relates to
-
QTBUG-36811 Qml date behaves unexpectedly for negative years
- Closed
For Gerrit Dashboard: QTBUG-29491 | ||||||
---|---|---|---|---|---|---|
# | Subject | Branch | Project | Status | CR | V |
98045,2 | Properly handle negative years when printing JS Dates to strings. | 5.4 | qt/qtdeclarative | Status: MERGED | +2 | 0 |
98065,2 | Adjust negative years when parsing dates from strings | 5.4 | qt/qtdeclarative | Status: ABANDONED | 0 | 0 |
98174,2 | Make conversion between JS Date and QDateTime as useful as possible | 5.4 | qt/qtdeclarative | Status: ABANDONED | 0 | 0 |
102019,3 | Document behavior of JavaScript Date with negative years | dev | qt/qtdeclarative | Status: MERGED | +2 | 0 |