Bug 17524 - Datepicker on checkout fails when dateformat = iso
Summary: Datepicker on checkout fails when dateformat = iso
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Circulation (show other bugs)
Version: master
Hardware: All All
: P5 - low major (vote)
Assignee: Jonathan Druart
QA Contact: Testopia
URL:
Whiteboard:
Keywords:
Depends on: 14060
Blocks:
  Show dependency treegraph
 
Reported: 2016-10-31 14:40 UTC by Magnus Enger
Modified: 2017-06-14 22:13 UTC (History)
7 users (show)

See Also:
Change sponsored?: ---
Patch complexity: ---
Bot Control: ---
When did the bot last check this:
Who signed the patch off:
Text to go in the release notes:


Attachments
Bug 17524: Fix datepicker check for iso dates (1.31 KB, patch)
2016-10-31 14:43 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 17524: Fix datepicker check for iso dates (1.36 KB, patch)
2016-10-31 15:41 UTC, M. Tompsett
Details | Diff | Splinter Review
Bug 17524: Fix datepicker check for iso dates (1.41 KB, patch)
2016-10-31 15:51 UTC, Nick Clemens
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Magnus Enger 2016-10-31 14:40:23 UTC
This surfaced after upgrading to 16.05.05. To reproduce:

- Make sure dateformat = iso
- Go to the checkout screen for some patron
- Click on "Checkout settings"
- Try to pick a date from the calendar -> nothing happens
- Try to enter an iso date -> you get a js popup saying "Please enter a valid date (should match yyyy-mm-dd)"
Comment 1 Nick Clemens 2016-10-31 14:42:55 UTC Comment hidden (obsolete)
Comment 2 Jonathan Druart 2016-10-31 14:43:22 UTC
Created attachment 57001 [details] [review]
Bug 17524: Fix datepicker check for iso dates

Iso dates are yyyy-mm-dd, the is_valid JS function
expects \d{2}-\d{2}-\d{4} when it should be \d{4}-\d{2}-\d{2}

Test plan:
Switch DateFormat to iso
Set a due date using the datepicker
=> Should work as expected
Comment 3 Jonathan Druart 2016-10-31 14:44:49 UTC
Caused by bug 14060
Comment 4 Jonathan Druart 2016-10-31 14:46:21 UTC
This should be backported ASAP, please test & QA quickly.
Comment 5 Magnus Enger 2016-10-31 14:47:33 UTC
I have applied the fix to a live server and it works, I'll do a signoff later today if noone beats me to it. Thanks for a very quick fix, Jonathan!
Comment 6 Magnus Enger 2016-10-31 14:47:50 UTC Comment hidden (obsolete)
Comment 7 M. Tompsett 2016-10-31 15:41:05 UTC
Created attachment 57006 [details] [review]
Bug 17524: Fix datepicker check for iso dates

Iso dates are yyyy-mm-dd, the is_valid JS function
expects \d{2}-\d{2}-\d{4} when it should be \d{4}-\d{2}-\d{2}

Test plan:
Switch DateFormat to iso
Set a due date using the datepicker
=> Should work as expected

Signed-off-by: Mark Tompsett <mtompset@hotmail.com>
Comment 8 Nick Clemens 2016-10-31 15:51:20 UTC
Created attachment 57007 [details] [review]
Bug 17524: Fix datepicker check for iso dates

Iso dates are yyyy-mm-dd, the is_valid JS function
expects \d{2}-\d{2}-\d{4} when it should be \d{4}-\d{2}-\d{2}

Test plan:
Switch DateFormat to iso
Set a due date using the datepicker
=> Should work as expected

Signed-off-by: Mark Tompsett <mtompset@hotmail.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Comment 9 M. Tompsett 2016-10-31 17:02:39 UTC
P.S. This is bigger than just checkout. Member birth dates, for example.
Comment 10 Kyle M Hall 2016-11-02 10:57:54 UTC
Pushed to master for 16.11, thanks Jonathan!
Comment 11 Frédéric Demians 2016-11-02 18:36:17 UTC
Pushed in 16.05. Will be in 16.05.06.