Bugzilla – Attachment 118317 Details for
Bug 27937
Date of birth entered without correct format causes internal server error
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 27937: Set datepicker when date is valid
Bug-27937-Set-datepicker-when-date-is-valid.patch (text/plain), 1.66 KB, created by
Nick Clemens (kidclamp)
on 2021-03-16 13:17:07 UTC
(
hide
)
Description:
Bug 27937: Set datepicker when date is valid
Filename:
MIME Type:
Creator:
Nick Clemens (kidclamp)
Created:
2021-03-16 13:17:07 UTC
Size:
1.66 KB
patch
obsolete
>From cac3a8acb1bca9fb5fb251ef2f8f5debc34e77d2 Mon Sep 17 00:00:00 2001 >From: Nick Clemens <nick@bywatersolutions.com> >Date: Tue, 16 Mar 2021 13:13:57 +0000 >Subject: [PATCH] Bug 27937: Set datepicker when date is valid > >When validating dates in JavaScript it is acceptable to have single digit days or months e.g,: >2011-6-16 > >When parsing in Koha::DateUtils->dt_from_string we die on these > >This patch uses JS to set the datepicker which normalizes the date as Koha expects > >To test: > 1 - Add new patron > 2 - Enter birthdate as 2/11/1986 > 3 - Complete required fields > 4 - Save > 5 - Get ISE > The given date (2/11/1986) does not match the date format (us) at /kohadevbox/koha/Koha/DateUtils.pm line 175 > 6 - Apply patch > 7 - Repeat 1-2 > 8 - Note that when you change focus (click on another field) the date is formatted as '02/11/1986' > 9 - Save patron, success! >10 - Edit patron, try setting DOB to 2/1/1986 >11 - Change focus and note date is formatted as '02/01/1986', save >12 - Repeat with other settings of system preference 'dateformat' >--- > koha-tmpl/intranet-tmpl/prog/js/calendar.js | 2 ++ > 1 file changed, 2 insertions(+) > >diff --git a/koha-tmpl/intranet-tmpl/prog/js/calendar.js b/koha-tmpl/intranet-tmpl/prog/js/calendar.js >index 1f312e813d..5759fdf7ec 100644 >--- a/koha-tmpl/intranet-tmpl/prog/js/calendar.js >+++ b/koha-tmpl/intranet-tmpl/prog/js/calendar.js >@@ -192,6 +192,8 @@ $(document).ready(function () { > }).on("change", function () { > if (!is_valid_date($(this).val())) { > $(this).val(""); >+ } else { >+ $(this).datepicker("setDate",$(this).val()); > } > }); > // http://jqueryui.com/demos/datepicker/#date-range >-- >2.11.0
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 27937
:
118315
|
118316
|
118317
|
118368
|
119069
|
119070
|
119084