Details
-
Bug
-
Resolution: Fixed
-
P2: Important
-
6.4.2, 6.5.0 Beta3
-
-
17d0bf258 (dev), 178fefa07 (6.5)
Description
Instructions on reproduce the issue
Run attached test project and see application output.
Error output:
qml: 1993-2->0 qml: 1993-3->0 qml: 1993-4->2 qml: 1993-5->2 qml: 1993-6->4 qml: 1993-7->4 qml: 1993-8->6 qml: 1993-9->7 qml: 1993-10->7 qml: 1993-11->9 qml: 1993-12->9 qml: 1994-1->11 qml: 1994-2->12 qml: 1994-3->12 qml: 1994-4->14 qml: 1994-5->14 qml: 1994-6->16 qml: 1994-7->16 qml: 1994-8->18 qml: 1994-9->19 qml: 1994-10->19 qml: 1994-11->21 qml: 1994-12->21
Expected output:
qml: 1993-2->0 qml: 1993-3->1 qml: 1993-4->2 qml: 1993-5->3 qml: 1993-6->4 qml: 1993-7->5 qml: 1993-8->6 qml: 1993-9->7 qml: 1993-10->8 qml: 1993-11->9 qml: 1993-12->10 qml: 1994-1->11 qml: 1994-2->12 qml: 1994-3->13 qml: 1994-4->14 qml: 1994-5->15 qml: 1994-6->16 qml: 1994-7->17 qml: 1994-8->18 qml: 1994-9->19 qml: 1994-10->20 qml: 1994-11->21 qml: 1994-12->22
More detail
This is a bug in our implementation:(in function QQuickCalendarModelPrivate::getCount, qquickcalendarmodel.cpp line 107)
QDate r = QDate(1, 1, 1).addDays(days); int years = r.year() - 1; int months = r.month() - 1; return 12 * years + months + (r.day() / t.day());
it uses days to calculation number of months, and when the date stops in February, there will only be 28 days and failed to add extra 1 to return value. Please also see attached test project's output.
Attachments
For Gerrit Dashboard: QTBUG-111634 | ||||||
---|---|---|---|---|---|---|
# | Subject | Branch | Project | Status | CR | V |
463875,6 | Fix counting of number of months from one date to another | dev | qt/qtdeclarative | Status: MERGED | +2 | 0 |
465891,1 | Fix counting of number of months from one date to another | 6.4 | qt/qtdeclarative | Status: ABANDONED | 0 | 0 |
465892,4 | Fix counting of number of months from one date to another | 6.5 | qt/qtdeclarative | Status: MERGED | +2 | 0 |