@@ -, +, @@ dmydot format - koha-tmpl/intranet-tmpl/prog/en/includes/calendar.inc - koha-tmpl/intranet-tmpl/prog/en/includes/date-format.inc - koha-tmpl/intranet-tmpl/prog/en/includes/patron-search.inc - koha-tmpl/intranet-tmpl/prog/en/modules/tools/holidays.tt - koha-tmpl/opac-tmpl/bootstrap/en/includes/calendar.inc - tools/holidays.pl - Apply patch - Make sure that you have syspref dateformat set to dmydot - Use datepicker in OPAC (modify birth date), verify that after choosing a date, it is displayed correctly in the datepicker - Use datepicker at several places in OPAC, verify that after choosing a date the date displays properly in datepicker and that the dater format is properly indicated (e.g. near birth date or near "Specify due date"). - Verify that datepicker works well with hoiday editing and that "From date:" displays properly --- koha-tmpl/intranet-tmpl/prog/en/includes/calendar.inc | 6 ++++-- koha-tmpl/intranet-tmpl/prog/en/includes/date-format.inc | 2 +- koha-tmpl/intranet-tmpl/prog/en/includes/patron-search.inc | 2 ++ koha-tmpl/intranet-tmpl/prog/en/modules/tools/holidays.tt | 4 ++-- koha-tmpl/opac-tmpl/bootstrap/en/includes/calendar.inc | 6 ++++-- tools/holidays.pl | 5 ++++- 6 files changed, 17 insertions(+), 8 deletions(-) --- a/koha-tmpl/intranet-tmpl/prog/en/includes/calendar.inc +++ a/koha-tmpl/intranet-tmpl/prog/en/includes/calendar.inc @@ -8,7 +8,7 @@ var sentmsg = 0; if (debug > 1) {alert("dateformat: " + dformat + "\ndebug is on (level " + debug + ")");} function Date_from_syspref(dstring) { - var dateX = dstring.split(/[-/]/); + 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) @@ -16,6 +16,8 @@ function Date_from_syspref(dstring) { 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 (dformat === "dmydot") { + 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; @@ -66,7 +68,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: "[% IF ( dateformat == "us" ) %]mm/dd/yy[% ELSIF ( dateformat == "metric" ) %]dd/mm/yy[% ELSIF ( dateformat == "dmydot" ) %]dd.mm.yy[% ELSE %]yy-mm-dd[% END %]", firstDay: [% Koha.Preference('CalendarFirstDayOfWeek') %], isRTL: [% IF ( bidi ) %]true[% ELSE %]false[% END %], showMonthAfterYear: false, --- a/koha-tmpl/intranet-tmpl/prog/en/includes/date-format.inc +++ a/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 %] +[% IF ( dateformat == "us" ) %](MM/DD/YYYY)[% ELSIF ( dateformat == "metric" ) %](DD/MM/YYYY)[% ELSIF ( dateformat == "dmydot" ) %](DD.MM.YYYY)[% ELSE %](YYYY-MM-DD)[% END %] --- a/koha-tmpl/intranet-tmpl/prog/en/includes/patron-search.inc +++ a/koha-tmpl/intranet-tmpl/prog/en/includes/patron-search.inc @@ -160,6 +160,8 @@ $(document).ready(function() { 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'"); + [% ELSIF dateformat == 'dmydot' %] + var MSG_DATE_FORMAT = _("Dates of birth should be entered in the format 'DD.MM.YYYY'"); [% END %] $('#searchmember').attr("title",MSG_DATE_FORMAT).tooltip('show'); } else { --- a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/holidays.tt +++ a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/holidays.tt @@ -260,7 +260,7 @@ td.repeatableyearly a.ui-state-default { background: #FFCC66 none; color : Bl From date: , - [% IF ( dateformat == "us" ) %]//[% ELSIF ( dateformat == "metric" ) %]//[% ELSE %]//[% END %] + [% IF ( dateformat == "us" ) %]//[% ELSIF ( dateformat == "metric") %]//[% ELSIF ( dateformat == "dmydot") %]..[% ELSE %]//[% END %] @@ -331,7 +331,7 @@ td.repeatableyearly a.ui-state-default { background: #FFCC66 none; color : Bl From date: , - [% IF ( dateformat == "us" ) %]//[% ELSIF ( dateformat == "metric" ) %]//[% ELSE %]//[% END %] + [% IF ( dateformat == "us" ) %]//[% ELSIF ( dateformat == "metric" || dateformat == "dmydot" ) %]//[% ELSE %]//[% END %] --- a/koha-tmpl/opac-tmpl/bootstrap/en/includes/calendar.inc +++ a/koha-tmpl/opac-tmpl/bootstrap/en/includes/calendar.inc @@ -7,7 +7,7 @@ if (debug > 1) {alert("dateformat: " + dformat + "\ndebug is on (level " + debug + ")");} function Date_from_syspref(dstring) { - var dateX = dstring.split(/[-/]/); + 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) @@ -15,6 +15,8 @@ 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 (dformat === "dmydot") { + 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; @@ -37,7 +39,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: '[% IF ( dateformat == "us" ) %]mm/dd/yy[% ELSIF ( dateformat == "metric" ) %]dd/mm/yy[% ELSIF ( dateformat == "dmydot" ) %]dd.mm.yy[% ELSE %]yy-mm-dd[% END %]', firstDay: [% Koha.Preference('CalendarFirstDayOfWeek') %], isRTL: [% IF ( bidi ) %]true[% ELSE %]false[% END %], showMonthAfterYear: false, --- a/tools/holidays.pl +++ a/tools/holidays.pl @@ -99,7 +99,10 @@ foreach my $monthDay (keys %$day_month_holidays) { if (C4::Context->preference("dateformat") eq "metric") { $day_monthdate_sort = "$day_month_holidays->{$monthDay}{month}-$day_month_holidays->{$monthDay}{day}"; $day_monthdate = "$day_month_holidays->{$monthDay}{day}/$day_month_holidays->{$monthDay}{month}"; - } elsif (C4::Context->preference("dateformat") eq "us") { + } elsif (C4::Context->preference("dateformat") eq "dmydot") { + $day_monthdate_sort = "$day_month_holidays->{$monthDay}{month}.$day_month_holidays->{$monthDay}{day}"; + $day_monthdate = "$day_month_holidays->{$monthDay}{day}.$day_month_holidays->{$monthDay}{month}"; + }elsif (C4::Context->preference("dateformat") eq "us") { $day_monthdate = "$day_month_holidays->{$monthDay}{month}/$day_month_holidays->{$monthDay}{day}"; $day_monthdate_sort = $day_monthdate; } else { --