Bug 399681 - allow date picker date to roll across month boundaries
Summary: allow date picker date to roll across month boundaries
Status: RESOLVED FIXED
Alias: None
Product: kmymoney
Classification: Applications
Component: general (show other bugs)
Version: unspecified
Platform: Gentoo Packages Linux
: NOR wishlist
Target Milestone: ---
Assignee: KMyMoney Devel Mailing List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-10-11 21:34 UTC by Jack
Modified: 2019-02-23 13:43 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jack 2018-10-11 21:34:01 UTC
SUMMARY
In the date picker, selecting the date (often the default selection when the application opens the date picker) allows up/down arrow, but only between the first and last date of the month.  I would like this scrolling to go past the month boundary.

STEPS TO REPRODUCE
1. Trigger a date picker in any app
2. Select the date
3. Try to down arrouw past 1 or up past the last day of month

OBSERVED RESULT
The date stops at either 1 or the last date of the month

DESIRED RESULT
Scrolling down from 1 should reset to the last date of the previous month (or even year) and scrolling up from the last date of the month should go to the first date of the next month (or even year.)  

I can imagine this might be configurable whether the user wants this behavior or not.

SOFTWARE VERSIONS
(available in About System)
KDE Plasma Version: 5.12.5
KDE Frameworks Version: 5.50.0
Qt Version: 5.9.6

ADDITIONAL INFORMATION
Comment 1 Christoph Feck 2019-01-29 10:21:52 UTC
Are you talking about the date field that you get when running "kcmshell5 clock"?
Comment 2 Jack 2019-01-29 14:48:36 UTC
No, but that one has a similar effect.  If you click into the seconds part of the time display, then the up or down arrow circles from 0 -> 59 -> 0 but when it goes from 59 to 0, the minutes don't go up by one.  (I don't think that's really a problem in this case, I'm just trying to explain.)
My use case is with the transaction date in KMyMoney.  I'll have to go dig into the code to see exactly which widget is being used.
Comment 3 Jack 2019-01-29 19:00:29 UTC
It looks like the lineedit date entry below the calendar in "kcmshell5 clock" but behaves differently.  It looks like a line edit, but acts as if the date, month, and year are separate widgets.

I thought it might be the KDateWidget, but as I search the KMyMoney source, it looks like it might actually be a custom widget.  I'll have to confirm with the KMyMoney developers.
Comment 4 Thomas Baumgart 2019-01-30 15:09:06 UTC
Jack refers to the KMyMoneyDateInput widget which is based on QDateEdit with a bit of magic around it. One of the magical things it provides is the feature Jack asks for by simply using the + and - key. This is even documented in the paragraph below the date widget shown on https://docs.kde.org/stable4/en/extragear-office/kmymoney/reference.widgets.html#reference.widgets.datepicker
Comment 5 Jack 2019-01-30 15:15:09 UTC
Thomas - that's not the widget I'm talking about, unless it also covers the case in the transaction editor when it's only the line edit portion visible.  Also, I've only tried the up and down arrows (including the arrows to the right of the date.)  If +/- does what I want (I'll test later) I might just change this to also recognizing the arrow keys.
Comment 6 Jack 2019-01-30 22:11:59 UTC
OK, my bad for not digging deeper.  The + and - do exactly what I want.  

The doc which you link to is also identical in stable5, which just reminds me how far behind I am in updating the manual for 5.x.

This is already a wishlist - should I reassign to KMM specifically to extend the +/- behavior to the up and down arrow keys, and optionally, the up and down arrows to the right of the line edit.
Comment 7 Jack 2019-02-03 00:06:46 UTC
I just discovered that the current behavior is only partly what I want.  I had not realized that the +/- change day, no matter where the cursor is in the line edit, where the up and down arrows work on the specific part of the date showing the cursor (day, month, or year).  I would like to be able to go up from December, landing on January of the next year, with the day unchanged.  I suppose that would take a bit more "magic" and thus moving this off to an even further "eventually."
Comment 8 Christoph Feck 2019-02-03 03:12:18 UTC
I am still not sure which widget class you are using. It might even be a simple QDateTimeEdit, making this ticket an upstream request.
Comment 9 Jack 2019-02-03 18:56:13 UTC
cfeck: see Comment #4.  It turns out to be a custom widget in KMM, which is why in Comment 6 I asked if it would be more appropriate to reassign this to KMM, but I'd prefer Thomas respond before I do that.
Comment 10 Christoph Feck 2019-02-22 14:41:48 UTC
Reassigning to KMyMoney developers to investigate which widget is actually used.
Comment 11 Thomas Baumgart 2019-02-23 13:43:28 UTC
Git commit a9b6160f3cbd1c440ae9aff515dbf07132a0eeed by Thomas Baumgart.
Committed on 23/02/2019 at 13:38.
Pushed by tbaumgart into branch '5.0'.

Improve date change feature

The current behavior of the + and - key in a date selection widget was
to increase or decrease by day and roll over into the next resp. previous
month. This has been enhanced to increase/decrease by day/month/year
depending on the current section holding the cursor with the month doing
a roll over into the next/previous year.

M  +18   -2    kmymoney/widgets/kmymoneydateinput.cpp

https://commits.kde.org/kmymoney/a9b6160f3cbd1c440ae9aff515dbf07132a0eeed