Bugzilla – Attachment 27107 Details for
Bug 12072
New dateformat dd.mm.yyyy
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Add date format dd.mm.yyyy, known internally as dmydot.
Add-date-format-ddmmyyyy-known-internally-as-dmydo.patch (text/plain), 22.52 KB, created by
Bernardo Gonzalez Kriegel
on 2014-04-14 22:18:22 UTC
(
hide
)
Description:
Add date format dd.mm.yyyy, known internally as dmydot.
Filename:
MIME Type:
Creator:
Bernardo Gonzalez Kriegel
Created:
2014-04-14 22:18:22 UTC
Size:
22.52 KB
patch
obsolete
>From d5f0d6d0730b3f9c2679246a21a1f4056e2ffb4b Mon Sep 17 00:00:00 2001 >From: Pasi Kallinen <pasi.kallinen@pttk.fi> >Date: Fri, 11 Apr 2014 11:16:18 +0300 >Subject: [PATCH] Add date format dd.mm.yyyy, known internally as dmydot. > >Make it much easier to add other date formats by passing the >date format string to the templates, instead of hard-coding >the allowed formats. > >http://bugs.koha-community.org/show_bug.cgi?id=12072 > >Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com> >Better version. Works as described. >Small koha-qa errors fixed in followup >--- > C4/Dates.pm | 15 ++++++++++++--- > C4/Templates.pm | 1 + > Koha/DateUtils.pm | 9 +++++++++ > installer/data/mysql/sysprefs.sql | 2 +- > installer/data/mysql/updatedatabase.pl | 10 ++++++++++ > .../intranet-tmpl/prog/en/includes/calendar.inc | 16 ++-------------- > .../intranet-tmpl/prog/en/includes/date-format.inc | 2 +- > .../prog/en/includes/patron-search.inc | 9 +-------- > .../en/modules/admin/preferences/i18n_l10n.pref | 1 + > .../intranet-tmpl/prog/en/modules/circ/offline.tt | 2 +- > .../prog/en/modules/tools/holidays.tt | 8 ++------ > .../opac-tmpl/bootstrap/en/includes/calendar.inc | 16 ++-------------- > .../bootstrap/en/includes/date-format.inc | 2 +- > koha-tmpl/opac-tmpl/prog/en/includes/calendar.inc | 16 ++-------------- > .../opac-tmpl/prog/en/includes/date-format.inc | 2 +- > tools/exceptionHolidays.pl | 19 +++++-------------- > tools/newHolidays.pl | 18 +++++------------- > 17 files changed, 57 insertions(+), 91 deletions(-) > >diff --git a/C4/Dates.pm b/C4/Dates.pm >index 4fd08ae..d536079 100644 >--- a/C4/Dates.pm >+++ b/C4/Dates.pm >@@ -40,20 +40,21 @@ use vars qw($prefformat); > > sub _prefformat { > unless ( defined $prefformat ) { >- $prefformat = C4::Context->preference('dateformat'); >+ $prefformat = C4::Context->preference('dateformat') || 'us'; > } > return $prefformat; > } > > sub reset_prefformat { # subroutine to clear the prefformat, called when we change it > if (defined $prefformat){ >- $prefformat = C4::Context->preference('dateformat'); >+ $prefformat = C4::Context->preference('dateformat') || 'us'; > } > } > > our %format_map = ( > iso => 'yyyy-mm-dd', # plus " HH:MM:SS" > metric => 'dd/mm/yyyy', # plus " HH:MM:SS" >+ dmydot => 'dd.mm.yyyy', > us => 'mm/dd/yyyy', # plus " HH:MM:SS" > sql => 'yyyymmdd HHMMSS', > rfc822 => 'a, dd b y HH:MM:SS z ', >@@ -61,6 +62,7 @@ our %format_map = ( > our %posix_map = ( > iso => '%Y-%m-%d', # or %F, "Full Date" > metric => '%d/%m/%Y', >+ dmydot => '%d.%m.%Y', > us => '%m/%d/%Y', > sql => '%Y%m%d %H%M%S', > rfc822 => '%a, %d %b %Y %H:%M:%S %z', >@@ -70,6 +72,7 @@ our %dmy_subs = ( # strings to eval (after using regular ex > # make arrays for POSIX::strftime() > iso => '[(($6||0),($5||0),($4||0),$3, $2 - 1, $1 - 1900)]', > metric => '[(($6||0),($5||0),($4||0),$1, $2 - 1, $3 - 1900)]', >+ dmydot => '[(($6||0),($5||0),($4||0),$1, $2 - 1, $3 - 1900)]', > us => '[(($6||0),($5||0),($4||0),$2, $1 - 1, $3 - 1900)]', > sql => '[(($6||0),($5||0),($4||0),$3, $2 - 1, $1 - 1900)]', > rfc822 => '[($7, $6, $5, $2, $3, $4 - 1900, $8)]', >@@ -81,7 +84,7 @@ our @days = qw(Sun Mon Tue Wed Thu Fri Sat); > > sub regexp ($;$) { > my $self = shift; >- my $delim = qr/:?\:|\/|-/; # "non memory" cluster: no backreference >+ my $delim = qr/:?\:|\/|-|\./; # "non memory" cluster: no backreference > my $format = (@_) ? _recognize_format(shift) : ( $self->{'dateformat'} || _prefformat() ); > > # Extra layer of checking $self->{'dateformat'}. >@@ -213,6 +216,12 @@ sub format { # get or set dateformat: iso, metric, us, etc. > $self->{'dateformat'} = _recognize_format(shift); > } > >+# get format string, eg. "yyyy-mm-dd" >+sub formatstr { >+ my $self = shift; >+ return $format_map{$self->{'dateformat'}}; >+} >+ > sub visual { > my $self = shift; > if (@_) { >diff --git a/C4/Templates.pm b/C4/Templates.pm >index 2d2304f..52e8d39 100644 >--- a/C4/Templates.pm >+++ b/C4/Templates.pm >@@ -112,6 +112,7 @@ sub output { > $vars->{opacsmallimage} = C4::Context->preference('opacsmallimage'); > $vars->{opaclayoutstylesheet} = > C4::Context->preference('opaclayoutstylesheet'); >+ $vars->{dateformatstyle} = C4::Dates->new()->formatstr(); > > # add variables set via param to $vars for processing > # and clean any utf8 mess >diff --git a/Koha/DateUtils.pm b/Koha/DateUtils.pm >index ea57778..1659863 100644 >--- a/Koha/DateUtils.pm >+++ b/Koha/DateUtils.pm >@@ -68,6 +68,10 @@ sub dt_from_string { > $date_string =~ s#-#/#g; > $date_string =~ s/^00/01/; # system allows the 0th of the month > $date_string =~ s#^(\d{1,2})/(\d{1,2})#$2/$1#; >+ } elsif ( $date_format eq 'dmydot' ) { >+ $date_string =~ s#\.#/#g; >+ $date_string =~ s/^00/01/; # system allows the 0th of the month >+ $date_string =~ s#^(\d{1,2})/(\d{1,2})#$2/$1#; > } else { > if ( $date_format eq 'iso' ) { > $date_string =~ s/-00/-01/; >@@ -140,6 +144,11 @@ sub output_pref { > ? $dt->strftime("%d/%m/%Y") > : $dt->strftime("%d/%m/%Y $time"); > } >+ elsif ( $pref =~ m/^dmydot/ ) { >+ return $dateonly >+ ? $dt->strftime("%d.%m.%Y") >+ : $dt->strftime("%d.%m.%Y $time"); >+ } > elsif ( $pref =~ m/^us/ ) { > > return $dateonly >diff --git a/installer/data/mysql/sysprefs.sql b/installer/data/mysql/sysprefs.sql >index 661910b..179af72 100644 >--- a/installer/data/mysql/sysprefs.sql >+++ b/installer/data/mysql/sysprefs.sql >@@ -83,7 +83,7 @@ INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` > ('COinSinOPACResults','1','','If ON, use COinS in OPAC search results page. NOTE: this can slow down search response time significantly','YesNo'), > ('ConfirmFutureHolds','0','','Number of days for confirming future holds','Integer'), > ('CurrencyFormat','US','US|FR','Determines the display format of currencies. eg: \'36000\' is displayed as \'360 000,00\' in \'FR\' or \'360,000.00\' in \'US\'.','Choice'), >-('dateformat','us','metric|us|iso','Define global date format (us mm/dd/yyyy, metric dd/mm/yyy, ISO yyyy-mm-dd)','Choice'), >+('dateformat','us','metric|us|iso|dmydot','Define global date format (us mm/dd/yyyy, metric dd/mm/yyy, ISO yyyy-mm-dd, dmydot dd.mm.yyyy)','Choice'), > ('DebugLevel','2','0|1|2','Define the level of debugging information sent to the browser when errors are encountered (set to 0 in production). 0=none, 1=some, 2=most','Choice'), > ('decreaseLoanHighHolds',NULL,'','Decreases the loan period for items with number of holds above the threshold specified in decreaseLoanHighHoldsValue','YesNo'), > ('decreaseLoanHighHoldsDuration',NULL,'','Specifies a number of days that a loan is reduced to when used in conjunction with decreaseLoanHighHolds','Integer'), >diff --git a/installer/data/mysql/updatedatabase.pl b/installer/data/mysql/updatedatabase.pl >index 6db5569..e71ab7d 100755 >--- a/installer/data/mysql/updatedatabase.pl >+++ b/installer/data/mysql/updatedatabase.pl >@@ -8120,6 +8120,16 @@ if ( CheckVersion($DBversion) ) { > SetVersion($DBversion); > } > >+$DBversion = "3.15.00.XXX"; >+if(CheckVersion($DBversion)) { >+ $dbh->do(q{ >+ UPDATE systempreferences SET options = 'metric|us|iso|dmydot', explanation = 'Define global date format (us mm/dd/yyyy, metric dd/mm/yyy, ISO yyyy-mm-dd, DMY separated by dots dd.mm.yyyy)' WHERE variable = 'dateformat' >+ }); >+ print "Upgrade to $DBversion done (Bug 12072 - New dateformat dd.mm.yyyy)\n"; >+ SetVersion($DBversion); >+} >+ >+ > =head1 FUNCTIONS > > =head2 TableExists($table) >diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/calendar.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/calendar.inc >index 1337044..0ae6fce 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/includes/calendar.inc >+++ b/koha-tmpl/intranet-tmpl/prog/en/includes/calendar.inc >@@ -3,22 +3,10 @@ > > var debug = "[% debug %]"; > var dformat = "[% dateformat %]"; >-var sentmsg = 0; > if (debug > 1) {alert("dateformat: " + dformat + "\ndebug is on (level " + debug + ")");} > > function Date_from_syspref(dstring) { >- var dateX = dstring.split(/[-/]/); >- if (debug > 1 && sentmsg < 1) {sentmsg++; alert("Date_from_syspref(" + dstring + ") splits to:\n" + dateX.join("\n"));} >- if (dformat === "iso") { >- return new Date(dateX[0], (dateX[1] - 1), dateX[2]); // YYYY-MM-DD to (YYYY,m(0-11),d) >- } else if (dformat === "us") { >- return new Date(dateX[2], (dateX[0] - 1), dateX[1]); // MM/DD/YYYY to (YYYY,m(0-11),d) >- } else if (dformat === "metric") { >- return new Date(dateX[2], (dateX[1] - 1), dateX[0]); // DD/MM/YYYY to (YYYY,m(0-11),d) >- } else { >- if (debug > 0) {alert("KOHA ERROR - Unrecognized date format: " +dformat);} >- return 0; >- } >+ return $.datepicker.parseDate( "[% dateformatstyle | replace('yyyy', 'yy') %]", dstring ); > } > > /* Instead of including multiple localization files as you would normally see with >@@ -37,7 +25,7 @@ jQuery(function($){ > dayNamesShort: [_("Sun"), _("Mon"), _("Tue"), _("Wed"), _("Thu"), _("Fri"), _("Sat")], > dayNamesMin: [_("Su"),_("Mo"),_("Tu"),_("We"),_("Th"),_("Fr"),_("Sa")], > weekHeader: _("Wk"), >- dateFormat: "[% IF ( dateformat == "us" ) %]mm/dd/yy[% ELSIF ( dateformat == "metric" ) %]dd/mm/yy[% ELSE %]yy-mm-dd[% END %]", >+ dateFormat: "[% dateformatstyle | replace("yyyy", "yy") %]", > firstDay: [% CalendarFirstDayOfWeek %], > isRTL: [% IF ( bidi ) %]true[% ELSE %]false[% END %], > showMonthAfterYear: false, >diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/date-format.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/date-format.inc >index 53dae71..ef1bc67 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/includes/date-format.inc >+++ b/koha-tmpl/intranet-tmpl/prog/en/includes/date-format.inc >@@ -1 +1 @@ >-[% IF ( dateformat == "us" ) %](MM/DD/YYYY)[% ELSIF ( dateformat == "metric" ) %](DD/MM/YYYY)[% ELSE %](YYYY-MM-DD)[% END %] >+([% dateformatstyle | upper %]) >diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/patron-search.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/patron-search.inc >index bccd39c..7bec415 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/includes/patron-search.inc >+++ b/koha-tmpl/intranet-tmpl/prog/en/includes/patron-search.inc >@@ -24,16 +24,9 @@ > <option value='sort2'>Sort field 2</option> > </select> > <script type="text/javascript"> >- [% SET dateformat = Koha.Preference('dateformat') %] > $("#searchfields").change(function() { > if ( $(this).val() == 'dateofbirth' ) { >- [% IF dateformat == 'us' %] >- var MSG_DATE_FORMAT = _("Dates of birth should be entered in the format 'MM/DD/YYYY'"); >- [% ELSIF dateformat == 'iso' %] >- var MSG_DATE_FORMAT = _("Dates of birth should be entered in the format 'YYYY-MM-DD'"); >- [% ELSIF dateformat == 'metric' %] >- var MSG_DATE_FORMAT = _("Dates of birth should be entered in the format 'DD/MM/YYYY'"); >- [% END %] >+ var MSG_DATE_FORMAT = _("Dates of birth should be entered in the format '[% dateformatstyle | upper %]'"); > $('#searchmember').attr("title",MSG_DATE_FORMAT).tooltip('show'); > } else { > $('#searchmember').tooltip('destroy'); >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/i18n_l10n.pref b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/i18n_l10n.pref >index 02985d3..d6d7a47 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/i18n_l10n.pref >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/i18n_l10n.pref >@@ -6,6 +6,7 @@ I18N/L10N: > choices: > us: mm/dd/yyyy > metric: dd/mm/yyyy >+ dmydot: dd.mm.yyyy > iso: yyyy-mm-dd > - . > - >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/offline.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/offline.tt >index 49f443e..7ae1ceb 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/offline.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/offline.tt >@@ -37,7 +37,7 @@ var NO_UPLOAD_PENDING_MESSAGE = _("You do not have any pending transactions in t > > var start; > >-var dateformat = '[% IF ( dateformat_us ) %]mm/dd/yy[% ELSIF ( dateformat_metric ) %]dd/mm/yy[% ELSE %]yy-mm-dd[% END %]'; >+var dateformat = '[% dateformatstyle | replace("yyyy", "yy") %]'; > > function checkin(barcode, item, error) { > var alerts = checkAlerts(barcode, item); >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/holidays.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/holidays.tt >index ea001e4..8782fc0 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/holidays.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/holidays.tt >@@ -255,9 +255,7 @@ td.repeatableyearly a.ui-state-default { background: #FFFF99 none; color : Bl > <li> > <strong>From Date:</strong> > <span id="showDaynameOutput"></span>, >- >- [% IF ( dateformat == "us" ) %]<span id="showMonthOutput"></span>/<span id="showDayOutput"></span>/<span id="showYearOutput"></span>[% ELSIF ( dateformat == "metric" ) %]<span id="showDayOutput"></span>/<span id="showMonthOutput"></span>/<span id="showYearOutput"></span>[% ELSE %]<span id="showYearOutput"></span>/<span id="showMonthOutput"></span>/<span id="showDayOutput"></span>[% END %] >- >+ [% dateformatstyle | replace('yyyy', '<span id="showYearOutput"></span>') | replace('mm', '<span id="showMonthOutput"></span>') | replace('dd', '<span id="showDayOutput"></span>') %] > <input type="hidden" id="showDayname" name="showDayname" /> > <input type="hidden" id="showWeekday" name="showWeekday" /> > <input type="hidden" id="showDay" name="showDay" /> >@@ -326,9 +324,7 @@ td.repeatableyearly a.ui-state-default { background: #FFFF99 none; color : Bl > <li> > <strong>From date:</strong> > <span id="newDaynameOutput"></span>, >- >- [% IF ( dateformat == "us" ) %]<span id="newMonthOutput"></span>/<span id="newDayOutput"></span>/<span id="newYearOutput"></span>[% ELSIF ( dateformat == "metric" ) %]<span id="newDayOutput"></span>/<span id="newMonthOutput"></span>/<span id="newYearOutput"></span>[% ELSE %]<span id="newYearOutput"></span>/<span id="newMonthOutput"></span>/<span id="newDayOutput"></span>[% END %] >- >+ [% dateformatstyle | replace('yyyy', '<span id="newYearOutput"></span>') | replace('mm', '<span id="newMonthOutput"></span>') | replace('dd', '<span id="newDayOutput"></span>') %] > <input type="hidden" id="newDayname" name="showDayname" /> > <input type="hidden" id="newWeekday" name="newWeekday" /> > <input type="hidden" id="newDay" name="newDay" /> >diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/includes/calendar.inc b/koha-tmpl/opac-tmpl/bootstrap/en/includes/calendar.inc >index 4280540..5ae9c6c 100644 >--- a/koha-tmpl/opac-tmpl/bootstrap/en/includes/calendar.inc >+++ b/koha-tmpl/opac-tmpl/bootstrap/en/includes/calendar.inc >@@ -2,22 +2,10 @@ > //<![CDATA[ > var debug = "[% debug %]"; > var dformat = "[% dateformat %]"; >- var sentmsg = 0; > if (debug > 1) {alert("dateformat: " + dformat + "\ndebug is on (level " + debug + ")");} > > function Date_from_syspref(dstring) { >- var dateX = dstring.split(/[-/]/); >- if (debug > 1 && sentmsg < 1) {sentmsg++; alert("Date_from_syspref(" + dstring + ") splits to:\n" + dateX.join("\n"));} >- if (dformat === "iso") { >- return new Date(dateX[0], (dateX[1] - 1), dateX[2]); // YYYY-MM-DD to (YYYY,m(0-11),d) >- } else if (dformat === "us") { >- return new Date(dateX[2], (dateX[0] - 1), dateX[1]); // MM/DD/YYYY to (YYYY,m(0-11),d) >- } else if (dformat === "metric") { >- return new Date(dateX[2], (dateX[1] - 1), dateX[0]); // DD/MM/YYYY to (YYYY,m(0-11),d) >- } else { >- if (debug > 0) {alert("KOHA ERROR - Unrecognized date format: " +dformat);} >- return 0; >- } >+ return $.datepicker.parseDate( "[% dateformatstyle | replace('yyyy', 'yy') %]", dstring ); > } > > /* Instead of including multiple localization files as you would normally see with >@@ -36,7 +24,7 @@ > dayNamesShort: [_("Sun"), _("Mon"), _("Tue"), _("Wed"), _("Thu"), _("Fri"), _("Sat")], > dayNamesMin: [_("Su"),_("Mo"),_("Tu"),_("We"),_("Th"),_("Fr"),_("Sa")], > weekHeader: _("Wk"), >- dateFormat: '[% IF ( dateformat == "us" ) %]mm/dd/yy[% ELSIF ( dateformat == "metric" ) %]dd/mm/yy[% ELSE %]yy-mm-dd[% END %]', >+ dateFormat: '[% dateformatstyle | replace("yyyy", "yy") %]', > firstDay: [% CalendarFirstDayOfWeek %], > isRTL: [% IF ( bidi ) %]true[% ELSE %]false[% END %], > showMonthAfterYear: false, >diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/includes/date-format.inc b/koha-tmpl/opac-tmpl/bootstrap/en/includes/date-format.inc >index f651b74..72eb1ea 100644 >--- a/koha-tmpl/opac-tmpl/bootstrap/en/includes/date-format.inc >+++ b/koha-tmpl/opac-tmpl/bootstrap/en/includes/date-format.inc >@@ -1 +1 @@ >-<span class="dateformat">[% IF ( dateformat == "us" ) %](MM/DD/YYYY)[% ELSIF ( dateformat == "metric" ) %](DD/MM/YYYY)[% ELSE %](YYYY-MM-DD)[% END %]</span> >+<span class="dateformat">([% dateformatstyle | upper %])</span> >diff --git a/koha-tmpl/opac-tmpl/prog/en/includes/calendar.inc b/koha-tmpl/opac-tmpl/prog/en/includes/calendar.inc >index eb660d1..f72a154 100644 >--- a/koha-tmpl/opac-tmpl/prog/en/includes/calendar.inc >+++ b/koha-tmpl/opac-tmpl/prog/en/includes/calendar.inc >@@ -3,22 +3,10 @@ > > var debug = "[% debug %]"; > var dformat = "[% dateformat %]"; >-var sentmsg = 0; > if (debug > 1) {alert("dateformat: " + dformat + "\ndebug is on (level " + debug + ")");} > > function Date_from_syspref(dstring) { >- var dateX = dstring.split(/[-/]/); >- if (debug > 1 && sentmsg < 1) {sentmsg++; alert("Date_from_syspref(" + dstring + ") splits to:\n" + dateX.join("\n"));} >- if (dformat === "iso") { >- return new Date(dateX[0], (dateX[1] - 1), dateX[2]); // YYYY-MM-DD to (YYYY,m(0-11),d) >- } else if (dformat === "us") { >- return new Date(dateX[2], (dateX[0] - 1), dateX[1]); // MM/DD/YYYY to (YYYY,m(0-11),d) >- } else if (dformat === "metric") { >- return new Date(dateX[2], (dateX[1] - 1), dateX[0]); // DD/MM/YYYY to (YYYY,m(0-11),d) >- } else { >- if (debug > 0) {alert("KOHA ERROR - Unrecognized date format: " +dformat);} >- return 0; >- } >+ return $.datepicker.parseDate( "[% dateformatstyle | replace('yyyy', 'yy') %]", dstring ); > } > > /* Instead of including multiple localization files as you would normally see with >@@ -37,7 +25,7 @@ jQuery(function($){ > dayNamesShort: [_("Sun"), _("Mon"), _("Tue"), _("Wed"), _("Thu"), _("Fri"), _("Sat")], > dayNamesMin: [_("Su"),_("Mo"),_("Tu"),_("We"),_("Th"),_("Fr"),_("Sa")], > weekHeader: _("Wk"), >- dateFormat: '[% IF ( dateformat == "us" ) %]mm/dd/yy[% ELSIF ( dateformat == "metric" ) %]dd/mm/yy[% ELSE %]yy-mm-dd[% END %]', >+ dateFormat: '[% dateformatstyle | replace("yyyy", "yy") %]', > firstDay: [% CalendarFirstDayOfWeek %], > isRTL: [% IF ( bidi ) %]true[% ELSE %]false[% END %], > showMonthAfterYear: false, >diff --git a/koha-tmpl/opac-tmpl/prog/en/includes/date-format.inc b/koha-tmpl/opac-tmpl/prog/en/includes/date-format.inc >index 53dae71..ed270f9 100644 >--- a/koha-tmpl/opac-tmpl/prog/en/includes/date-format.inc >+++ b/koha-tmpl/opac-tmpl/prog/en/includes/date-format.inc >@@ -1 +1 @@ >-[% IF ( dateformat == "us" ) %](MM/DD/YYYY)[% ELSIF ( dateformat == "metric" ) %](DD/MM/YYYY)[% ELSE %](YYYY-MM-DD)[% END %] >+([% dateformatstyle | upper %]) >\ No newline at end of file >diff --git a/tools/exceptionHolidays.pl b/tools/exceptionHolidays.pl >index 0a36a20..eb1affb 100755 >--- a/tools/exceptionHolidays.pl >+++ b/tools/exceptionHolidays.pl >@@ -40,21 +40,12 @@ if ($description) { > $description = ''; > } > >-# We format the date >+ >+my $datecancelrange = C4::Dates->new($datecancelrange)->output('iso'); > my @dateend = split(/[\/-]/, $datecancelrange); >-if (C4::Context->preference("dateformat") eq "metric") { >- $day1 = $dateend[0]; >- $month1 = $dateend[1]; >- $year1 = $dateend[2]; >-}elsif (C4::Context->preference("dateformat") eq "us") { >- $month1 = $dateend[0]; >- $day1 = $dateend[1]; >- $year1 = $dateend[2]; >-} else { >- $year1 = $dateend[0]; >- $month1 = $dateend[1]; >- $day1 = $dateend[2]; >-} >+$year1 = $dateend[0]; >+$month1 = $dateend[1]; >+$day1 = $dateend[2]; > > # We make an array with holiday's days > my @holiday_list; >diff --git a/tools/newHolidays.pl b/tools/newHolidays.pl >index 646276c..996b832 100755 >--- a/tools/newHolidays.pl >+++ b/tools/newHolidays.pl >@@ -34,20 +34,12 @@ my $calendardate = sprintf("%04d-%02d-%02d", $year, $month, $day); > my $isodate = C4::Dates->new($calendardate, 'iso'); > $calendardate = $isodate->output('syspref'); > >+my $dateofrange = C4::Dates->new($dateofrange)->output('iso'); > my @dateend = split(/[\/-]/, $dateofrange); >-if (C4::Context->preference("dateformat") eq "metric") { >- $day1 = $dateend[0]; >- $month1 = $dateend[1]; >- $year1 = $dateend[2]; >-}elsif (C4::Context->preference("dateformat") eq "us") { >- $month1 = $dateend[0]; >- $day1 = $dateend[1]; >- $year1 = $dateend[2]; >-} else { >- $year1 = $dateend[0]; >- $month1 = $dateend[1]; >- $day1 = $dateend[2]; >-} >+$year1 = $dateend[0]; >+$month1 = $dateend[1]; >+$day1 = $dateend[2]; >+ > $title || ($title = ''); > if ($description) { > $description =~ s/\r/\\r/g; >-- >1.7.9.5
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 12072
:
27068
|
27069
|
27082
|
27107
|
27108
|
27109
|
27118
|
27130
|
36726
|
36761
|
43317
|
43318
|
44463
|
44606
|
44747
|
44964
|
44966
|
44980
|
45020
|
45022