Bugzilla – Attachment 55256 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]
Bug 14060: Improve regex to limit year to 4 integers
Bug-14060-Improve-regex-to-limit-year-to-4-integer.patch (text/plain), 1.72 KB, created by
Nick Clemens (kidclamp)
on 2016-09-06 12:27:20 UTC
(
hide
)
Description:
Bug 14060: Improve regex to limit year to 4 integers
Filename:
MIME Type:
Creator:
Nick Clemens (kidclamp)
Created:
2016-09-06 12:27:20 UTC
Size:
1.72 KB
patch
obsolete
>From da78b8f9d62e0bb35e185c13b68753fa66c1fa65 Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Tue, 6 Sep 2016 12:58:31 +0100 >Subject: [PATCH] Bug 14060: Improve regex to limit year to 4 integers > >01/01/01984 should not be considered as a valid date. > >Signed-off-by: Nick Clemens <nick@bywatersolutions.com> >--- > 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 7175df2..aba713e 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/includes/calendar.inc >+++ b/koha-tmpl/intranet-tmpl/prog/en/includes/calendar.inc >@@ -14,16 +14,16 @@ 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; >+ if ( date.search(/^\d{2}\/\d{2}\/\d{4}($|\s)/) == -1 ) return 0; > dateformat = 'mm/dd/yy'; > } else if ( dateformat == 'metric' ) { >- if ( date.search(/\d{2}\/\d{2}\/\d{4}/) == -1 ) return 0; >+ if ( date.search(/^\d{2}\/\d{2}\/\d{4}($|\s)/) == -1 ) return 0; > dateformat = 'dd/mm/yy'; > } else if (dateformat == 'iso' ) { >- if ( date.search(/\d{2}-\d{2}-\d{4}/) == -1 ) return 0; >+ if ( date.search(/^\d{2}-\d{2}-\d{4}($|\s)/) == -1 ) return 0; > dateformat = 'yy-mm-dd'; > } else if ( dateformat == 'dmydot' ) { >- if ( date.search(/\d{2}\.\d{2}\.\d{4}/) == -1 ) return 0; >+ if ( date.search(/^\d{2}\.\d{2}\.\d{4}($|\s)/) == -1 ) return 0; > dateformat = 'dd.mm.yy'; > } > try { >-- >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