Bug 447576 - Event - Repeat - Ends - On: Date picker adds 1 month to selected month
Summary: Event - Repeat - Ends - On: Date picker adds 1 month to selected month
Status: RESOLVED FIXED
Alias: None
Product: Merkuro
Classification: Applications
Component: general (other bugs)
Version First Reported In: unspecified
Platform: Compiled Sources Linux
: NOR minor
Target Milestone: ---
Assignee: Claudio Cambra
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-12-27 14:00 UTC by aleksi.karpansalo
Modified: 2021-12-28 20:51 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed/Implemented In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description aleksi.karpansalo 2021-12-27 14:00:20 UTC
SUMMARY
When adding or editing a task or event, the Repeat setting's Ends On date picker does not work as expected.
When the user picks a date, the resulting date is 1 month in the future from the user picked date.

STEPS TO REPRODUCE
1. Start adding a new event
2. Set Repeat to anything but Never
3. Set the now visible Ends to On
4. Pick any date for now visible On

OBSERVED RESULT
The date will be a month later than was picked

EXPECTED RESULT
The date is what was picked

SOFTWARE/OS VERSIONS
Kalendar commit 2c4a29ea

ADDITIONAL INFORMATION
Seems to be caused by DateCombo using 1...12 for months while Date uses 0...11

src/contents/ui/IncidenceEditor.qml line ~637
onNewDateChosen: root.incidenceWrapper.setRecurrenceDataItem("endDateTime", new Date(year, month, day));
could be changed to
onNewDateChosen: root.incidenceWrapper.setRecurrenceDataItem("endDateTime", new Date(year, month-1, day));

This is the only place using "new Date(year, month, day)" to pass a DateCombo picked date as far as I can tell
Comment 1 Claudio Cambra 2021-12-28 20:51:49 UTC
Thanks for reporting this bug and for your investigation, you were right -- mismatch between the QDateTime-style month numbers and JS Date month numbers used by QML.

Fixed with latest commit!