Bug 34939 - When manually entering dates in flatPickr the hour and minute get set to 00:00 not 23:59
Summary: When manually entering dates in flatPickr the hour and minute get set to 00:0...
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Tools (show other bugs)
Version: Main
Hardware: All All
: P5 - low normal
Assignee: Lucas Gass (lukeg)
QA Contact: Katrin Fischer
URL:
Keywords:
: 34680 (view as bug list)
Depends on:
Blocks: 33703 35014
  Show dependency treegraph
 
Reported: 2023-09-27 21:16 UTC by Lucas Gass (lukeg)
Modified: 2024-07-04 20:40 UTC (History)
6 users (show)

See Also:
Change sponsored?: ---
Patch complexity: Small patch
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:
23.11.00,23.05.05,22.11.11
Circulation function:


Attachments
Bug 34939: Set hour:minute to 23:59 when inputing dates unless explicitly set (2.00 KB, patch)
2023-09-27 21:27 UTC, Lucas Gass (lukeg)
Details | Diff | Splinter Review
Bug 34939: Set hour:minute to 23:59 when inputing dates unless explicitly set (2.00 KB, patch)
2023-09-27 21:37 UTC, Lucas Gass (lukeg)
Details | Diff | Splinter Review
Bug 34939: Set hour:minute to 23:59 when inputing dates unless explicitly set (2.06 KB, patch)
2023-09-29 14:30 UTC, ByWater Sandboxes
Details | Diff | Splinter Review
Bug 34939: Set hour:minute to 23:59 when inputing dates unless explicitly set (2.12 KB, patch)
2023-10-02 20:09 UTC, Andrew Fuerste-Henry
Details | Diff | Splinter Review
Bug 34939: Set hour:minute to 23:59 when inputing dates unless explicitly set (2.17 KB, patch)
2023-10-03 11:09 UTC, Katrin Fischer
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Lucas Gass (lukeg) 2023-09-27 21:16:13 UTC
With flatPickr you can manually enter a date. If that date date allows for the input of hours and minutes and you do not manually specify those the default will be 00:00.

When you use the flatPickr calendar to pick a date time and no do specify the hour/minute it will default to 23:59. 

This should be consistent.
Comment 1 Lucas Gass (lukeg) 2023-09-27 21:19:58 UTC
To recreate: 

1. Find some places in the staff interface where data-flatpickr-enable-time is set to true. Examples: renew.tt or circulation.tt 
2. Directly input a date in whatever date format you have specified in DateFormat but omit the hour/minute. Example: 12/12/2023
3. See that the hour/minute default to 00:00 if your TimeFormat is 24hr and 12:00 AM if your time format is 12hr
Comment 2 Lucas Gass (lukeg) 2023-09-27 21:27:12 UTC
Created attachment 156309 [details] [review]
Bug 34939: Set hour:minute to 23:59 when inputing dates unless explicitly set

1. Find some places in the staff interface where data-flatpickr-enable-time is set to true. Examples: renew.tt or circulation.tt
2. Directly input a date in whatever date format you have specified in DateFormat but omit the hour/minute. Example: 12/12/2023
3. See that the hour/minute default to 00:00 if your TimeFormat is 24hr and 12:00 AM if your time format is 12hr
4. Apply patch, clear browser cache.
5. Try step again, setting a date like '12/12/2023'. The hour:minute should be added as 23:59.
6. With TimeFormat set to 24hr try entering a date with the hour:minute like '12/12/2023 11:22'. The hour:minute should be set to 11:22.
7. With TimeFormat set to 12hr try entering a date with the hour:minute like '12/12/2023 11:22 AM'. The hour:minute should be set to 11:22 AM.
8. Play with this in as many TimeFormat and DateFormat combonatinons as you can.
Comment 3 Lucas Gass (lukeg) 2023-09-27 21:37:13 UTC
Created attachment 156311 [details] [review]
Bug 34939: Set hour:minute to 23:59 when inputing dates unless explicitly set

1. Find some places in the staff interface where data-flatpickr-enable-time is set to true. Examples: renew.tt or circulation.tt
2. Directly input a date in whatever date format you have specified in DateFormat but omit the hour/minute. Example: 12/12/2023
3. See that the hour/minute default to 00:00 if your TimeFormat is 24hr and 12:00 AM if your time format is 12hr
4. Apply patch, clear browser cache.
5. Try step again, setting a date like '12/12/2023'. The hour:minute should be added as 23:59.
6. With TimeFormat set to 24hr try entering a date with the hour:minute like '12/12/2023 11:22'. The hour:minute should be set to 11:22.
7. With TimeFormat set to 12hr try entering a date with the hour:minute like '12/12/2023 11:22 AM'. The hour:minute should be set to 11:22 AM.
8. Play with this in as many TimeFormat and DateFormat combonatinons as you can.
Comment 4 ByWater Sandboxes 2023-09-29 14:30:45 UTC
Created attachment 156405 [details] [review]
Bug 34939: Set hour:minute to 23:59 when inputing dates unless explicitly set

1. Find some places in the staff interface where data-flatpickr-enable-time is set to true. Examples: renew.tt or circulation.tt
2. Directly input a date in whatever date format you have specified in DateFormat but omit the hour/minute. Example: 12/12/2023
3. See that the hour/minute default to 00:00 if your TimeFormat is 24hr and 12:00 AM if your time format is 12hr
4. Apply patch, clear browser cache.
5. Try step again, setting a date like '12/12/2023'. The hour:minute should be added as 23:59.
6. With TimeFormat set to 24hr try entering a date with the hour:minute like '12/12/2023 11:22'. The hour:minute should be set to 11:22.
7. With TimeFormat set to 12hr try entering a date with the hour:minute like '12/12/2023 11:22 AM'. The hour:minute should be set to 11:22 AM.
8. Play with this in as many TimeFormat and DateFormat combonatinons as you can.

Signed-off-by: Kristi Krueger <kkrueger@cuyahogalibrary.org>
Comment 5 David Nind 2023-10-01 19:11:36 UTC
Hi Kristi.

I think you've signed this off, but the status needs changing.

Could you change the status to signed off? (This also means that you will get credit on the dashboard under the sign-offs section https://dashboard.koha-community.org/ )

David Nind
New Zealand
Comment 6 Andrew Fuerste-Henry 2023-10-02 20:09:55 UTC
Created attachment 156461 [details] [review]
Bug 34939: Set hour:minute to 23:59 when inputing dates unless explicitly set

1. Find some places in the staff interface where data-flatpickr-enable-time is set to true. Examples: renew.tt or circulation.tt
2. Directly input a date in whatever date format you have specified in DateFormat but omit the hour/minute. Example: 12/12/2023
3. See that the hour/minute default to 00:00 if your TimeFormat is 24hr and 12:00 AM if your time format is 12hr
4. Apply patch, clear browser cache.
5. Try step again, setting a date like '12/12/2023'. The hour:minute should be added as 23:59.
6. With TimeFormat set to 24hr try entering a date with the hour:minute like '12/12/2023 11:22'. The hour:minute should be set to 11:22.
7. With TimeFormat set to 12hr try entering a date with the hour:minute like '12/12/2023 11:22 AM'. The hour:minute should be set to 11:22 AM.
8. Play with this in as many TimeFormat and DateFormat combonatinons as you can.

Signed-off-by: Kristi Krueger <kkrueger@cuyahogalibrary.org>
Signed-off-by: Andrew Fuerste-Henry <andrewfh@dubcolib.org>
Comment 7 Katrin Fischer 2023-10-03 11:09:11 UTC
Created attachment 156495 [details] [review]
Bug 34939: Set hour:minute to 23:59 when inputing dates unless explicitly set

1. Find some places in the staff interface where data-flatpickr-enable-time is set to true. Examples: renew.tt or circulation.tt
2. Directly input a date in whatever date format you have specified in DateFormat but omit the hour/minute. Example: 12/12/2023
3. See that the hour/minute default to 00:00 if your TimeFormat is 24hr and 12:00 AM if your time format is 12hr
4. Apply patch, clear browser cache.
5. Try step again, setting a date like '12/12/2023'. The hour:minute should be added as 23:59.
6. With TimeFormat set to 24hr try entering a date with the hour:minute like '12/12/2023 11:22'. The hour:minute should be set to 11:22.
7. With TimeFormat set to 12hr try entering a date with the hour:minute like '12/12/2023 11:22 AM'. The hour:minute should be set to 11:22 AM.
8. Play with this in as many TimeFormat and DateFormat combonatinons as you can.

Signed-off-by: Kristi Krueger <kkrueger@cuyahogalibrary.org>
Signed-off-by: Andrew Fuerste-Henry <andrewfh@dubcolib.org>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Comment 8 Katrin Fischer 2023-10-03 11:09:49 UTC
Key here is to type the date vs. picking it from the widget.
Comment 9 Tomás Cohen Arazi (tcohen) 2023-10-04 13:15:13 UTC
Pushed to master for 23.11.

Nice work everyone, thanks!
Comment 10 Fridolin Somers 2023-10-05 19:53:34 UTC
Pushed to 23.05.x for 23.05.05
Comment 11 Martin Renvoize (ashimema) 2023-10-09 15:34:10 UTC
I think this should only fire when enable-time is present on the input.. not for all flatpickrs

Opening a follow-up bug to fix that quickly.
Comment 12 David Nind 2023-10-10 07:20:45 UTC
Discussion on IRC - breaks bookings feature (under development- Bug 29002): https://irc.koha-community.org/koha/2023-10-09#i_2513012
Comment 13 Matt Blenkinsop 2023-10-17 17:12:11 UTC
Nice work everyone!

Pushed to oldstable for 22.11.x
Comment 14 Lari Strand 2023-11-20 08:43:08 UTC
*** Bug 34680 has been marked as a duplicate of this bug. ***