Bug 415028 - Night colors doesn't support times later than 19:00 (24 hour format)
Summary: Night colors doesn't support times later than 19:00 (24 hour format)
Status: RESOLVED FIXED
Alias: None
Product: systemsettings
Classification: Applications
Component: kcm_nightcolor (show other bugs)
Version: 5.17.4
Platform: Other Linux
: NOR normal (vote)
Target Milestone: ---
Assignee: Plasma Bugs List
URL:
Keywords:
: 418209 428589 429053 (view as bug list)
Depends on:
Blocks:
 
Reported: 2019-12-10 20:31 UTC by tony.spegel
Modified: 2023-01-01 02:44 UTC (History)
7 users (show)

See Also:
Latest Commit:
Version Fixed In: 5.26.5


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description tony.spegel 2019-12-10 20:31:02 UTC
SUMMARY


STEPS TO REPRODUCE
1. Open Night color settings
2. Select mode 'Times'
3. Try setting a time like 20:15

OBSERVED RESULT
You can't select such a time

EXPECTED RESULT
Being able to set a time later than 19:00

SOFTWARE/OS VERSIONS
Linux/KDE Plasma: 
(available in About System)
KDE Plasma Version: 5.17.4
KDE Frameworks Version: 5.64.0
Qt Version: 5.13.2
Comment 1 Nate Graham 2020-01-15 00:01:55 UTC
Time input using those text fields is generally quite borked. :/
Comment 2 Nate Graham 2020-02-26 18:58:28 UTC
*** Bug 418209 has been marked as a duplicate of this bug. ***
Comment 3 Nate Graham 2020-12-17 21:08:33 UTC
*** Bug 428589 has been marked as a duplicate of this bug. ***
Comment 4 David Edmundson 2021-09-09 15:50:19 UTC
*** Bug 429053 has been marked as a duplicate of this bug. ***
Comment 5 David Edmundson 2021-09-09 15:50:36 UTC

*** This bug has been marked as a duplicate of bug 413010 ***
Comment 6 mrfrh 2022-12-27 20:42:26 UTC
Reopened, as this is actually NOT a duplicate of https://bugs.kde.org/show_bug.cgi?id=413010 (which is only about time format).

I just wanted to report this issue myself as it could be very annoying to new users. Living in a 24hr-Timezone, you can't set a night color start time later than 19:00.

There seems to be a problem with the time input field:
1. open night color settings
2. select mode "individual times"
3. you can't enter any start time starting with two (e.g. 22:00), only times starting with one or zero (e.g. 19:00)
4. workaround: type 22:00 in a text editor and copy it --> 22:00 can be pasted in the input field.

Sometimes it also worked to at first try input a time starting with 1, then at second try it was possible to enter a time starting with 2. But I couldn't reproduce this reliably.

In fact the regex in /usr/share/kpackage/kcms/kcm_nightcolor/contents/ui/TimeField.qml looks correct (/^([0-1]?[0-9]|2[0-3]):[0-5][0-9]$/), so I' don't know what's the root cause of this issue :-(
Comment 7 mrfrh 2022-12-27 20:48:17 UTC
Sorry, forgot to specify up to date software versions:

SOFTWARE/OS VERSIONS
KDE Plasma Version: 5.26.4
KDE Frameworks Version: 5.101.0
Qt Version: 5.15.7
Comment 8 mrfrh 2022-12-31 14:39:17 UTC
I figured out that the problem is the "or"-part of the regex, this could be an underlying Qt Bug. 
Fortunately there seems to be an easy workaround, as the regex attempt here is more complicated than necessary. 
I'll try to submit a bugfix.
Comment 9 Bug Janitor Service 2022-12-31 14:53:41 UTC
A possibly relevant merge request was started @ https://invent.kde.org/plasma/plasma-workspace/-/merge_requests/2465
Comment 10 Fushan Wen 2023-01-01 02:42:24 UTC
Git commit be56079c4bff876d8c889abe99bfe46dd4004d67 by Fushan Wen, on behalf of Martin Frueh.
Committed on 01/01/2023 at 02:39.
Pushed by fusionfuture into branch 'master'.

Fix time input bug caused by "or" in regex

Removed or-condition in regex, Qt.ImhTime can take care of this.
FIXED-IN: tbd

M  +2    -2    kcms/nightcolor/package/contents/ui/TimeField.qml

https://invent.kde.org/plasma/plasma-workspace/commit/be56079c4bff876d8c889abe99bfe46dd4004d67
Comment 11 Fushan Wen 2023-01-01 02:43:19 UTC
Git commit 3059f250d7d07ad04f667ade017b67c8bcd34c14 by Fushan Wen, on behalf of Martin Frueh.
Committed on 01/01/2023 at 02:43.
Pushed by fusionfuture into branch 'cherry-pick-be56079c'.

Fix time input bug caused by "or" in regex

Removed or-condition in regex, Qt.ImhTime can take care of this.
FIXED-IN: tbd

(cherry picked from commit be56079c4bff876d8c889abe99bfe46dd4004d67)

M  +2    -2    kcms/nightcolor/package/contents/ui/TimeField.qml

https://invent.kde.org/plasma/plasma-workspace/commit/3059f250d7d07ad04f667ade017b67c8bcd34c14
Comment 12 Fushan Wen 2023-01-01 02:44:18 UTC
Git commit 66a8c134277791c53bc212578e4979f4db171f83 by Fushan Wen.
Committed on 01/01/2023 at 02:44.
Pushed by fusionfuture into branch 'Plasma/5.26'.

Fix time input bug caused by "or" in regex

Removed or-condition in regex, Qt.ImhTime can take care of this.
FIXED-IN: 5.26.5

(cherry picked from commit be56079c4bff876d8c889abe99bfe46dd4004d67)

M  +2    -2    kcms/nightcolor/package/contents/ui/TimeField.qml

https://invent.kde.org/plasma/plasma-workspace/commit/66a8c134277791c53bc212578e4979f4db171f83