Bugzilla – Attachment 55018 Details for
Bug 14060
Remove readonly on date inputs
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
[SIGNED-OFF] Bug 14060: Force leading zeros on date
SIGNED-OFF-Bug-14060-Force-leading-zeros-on-date.patch (text/plain), 1.89 KB, created by
Owen Leonard
on 2016-08-30 13:06:30 UTC
(
hide
)
Description:
[SIGNED-OFF] Bug 14060: Force leading zeros on date
Filename:
MIME Type:
Creator:
Owen Leonard
Created:
2016-08-30 13:06:30 UTC
Size:
1.89 KB
patch
obsolete
>From 55c6abe7bd85250737ba50e3e1f89cfe244fc730 Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Tue, 30 Aug 2016 09:54:55 +0100 >Subject: [PATCH] [SIGNED-OFF] Bug 14060: Force leading zeros on date >Content-Type: text/plain; charset="utf-8" > >If a date does not contain leading zeros for day and month, the date >will be refused. >parseDate function considers 1/1/1990 as a valid date, but our perl code >does not. We must refuse it. > >Signed-off-by: Owen Leonard <oleonard@myacpl.org> >--- > koha-tmpl/intranet-tmpl/prog/en/includes/calendar.inc | 8 ++++---- > 1 file changed, 4 insertions(+), 4 deletions(-) > >diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/calendar.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/calendar.inc >index 185a51c..14ec21d 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/includes/calendar.inc >+++ b/koha-tmpl/intranet-tmpl/prog/en/includes/calendar.inc >@@ -11,17 +11,17 @@ var MSG_PLEASE_ENTER_A_VALID_DATE = _("Please enter a valid date (should match % > function is_valid_date(date) { > var dateformat = dateformat_str = '[% Koha.Preference('dateformat') %]'; > if ( dateformat == 'us' ) { >+ if ( date.search(/\d{2}\/\d{2}\/\d{4}/) == -1 ) return 0; > dateformat = 'mm/dd/yy'; >- dateformat_str = 'mm/dd/yyyy'; > } else if ( dateformat == 'metric' ) { >+ if ( date.search(/\d{2}\/\d{2}\/\d{4}/) == -1 ) return 0; > dateformat = 'dd/mm/yy'; >- dateformat_str = 'dd/mm/yyyy'; > } else if (dateformat == 'iso' ) { >+ if ( date.search(/\d{2}-\d{2}-\d{4}/) == -1 ) return 0; > dateformat = 'yy-mm-dd'; >- dateformat_str = 'yyyy-mm-dd'; > } else if ( dateformat == 'dmydot' ) { >+ if ( date.search(/\d{2}\.\d{2}\.\d{4}/) == -1 ) return 0; > dateformat = 'dd.mm.yy'; >- dateformat_str = 'dd.mm.yyyy'; > } > try { > $.datepicker.parseDate(dateformat, date); >-- >2.1.4
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 14060
:
38484
|
38540
|
38541
|
44542
|
44543
|
44544
|
45282
|
46224
|
54606
|
54607
|
54608
|
54609
|
54610
|
54902
|
54903
|
54904
|
54905
|
54906
|
54907
|
55001
|
55002
|
55012
|
55013
|
55014
|
55015
|
55016
|
55017
|
55018
|
55019
|
55165
|
55246
|
55247
|
55248
|
55249
|
55250
|
55251
|
55252
|
55253
|
55254
|
55255
|
55256