View | Details | Raw Unified | Return to bug 12072
Collapse All | Expand All

(-)a/koha-tmpl/intranet-tmpl/prog/en/includes/calendar.inc (-2 / +4 lines)
Lines 8-14 var sentmsg = 0; Link Here
8
if (debug > 1) {alert("dateformat: " + dformat + "\ndebug is on (level " + debug + ")");}
8
if (debug > 1) {alert("dateformat: " + dformat + "\ndebug is on (level " + debug + ")");}
9
9
10
function Date_from_syspref(dstring) {
10
function Date_from_syspref(dstring) {
11
        var dateX = dstring.split(/[-/]/);
11
        var dateX = dstring.split(/[-/.]/);
12
        if (debug > 1 && sentmsg < 1) {sentmsg++; alert("Date_from_syspref(" + dstring + ") splits to:\n" + dateX.join("\n"));}
12
        if (debug > 1 && sentmsg < 1) {sentmsg++; alert("Date_from_syspref(" + dstring + ") splits to:\n" + dateX.join("\n"));}
13
        if (dformat === "iso") {
13
        if (dformat === "iso") {
14
                return new Date(dateX[0], (dateX[1] - 1), dateX[2]);  // YYYY-MM-DD to (YYYY,m(0-11),d)
14
                return new Date(dateX[0], (dateX[1] - 1), dateX[2]);  // YYYY-MM-DD to (YYYY,m(0-11),d)
Lines 16-21 function Date_from_syspref(dstring) { Link Here
16
                return new Date(dateX[2], (dateX[0] - 1), dateX[1]);  // MM/DD/YYYY to (YYYY,m(0-11),d)
16
                return new Date(dateX[2], (dateX[0] - 1), dateX[1]);  // MM/DD/YYYY to (YYYY,m(0-11),d)
17
        } else if (dformat === "metric") {
17
        } else if (dformat === "metric") {
18
                return new Date(dateX[2], (dateX[1] - 1), dateX[0]);  // DD/MM/YYYY to (YYYY,m(0-11),d)
18
                return new Date(dateX[2], (dateX[1] - 1), dateX[0]);  // DD/MM/YYYY to (YYYY,m(0-11),d)
19
        } else if (dformat === "dmydot") {
20
                return new Date(dateX[2], (dateX[1] - 1), dateX[0]);  // DD.MM.YYYY to (YYYY,m(0-11),d)
19
        } else {
21
        } else {
20
                if (debug > 0) {alert("KOHA ERROR - Unrecognized date format: " +dformat);}
22
                if (debug > 0) {alert("KOHA ERROR - Unrecognized date format: " +dformat);}
21
                return 0;
23
                return 0;
Lines 66-72 jQuery(function($){ Link Here
66
        dayNamesShort: [_("Sun"), _("Mon"), _("Tue"), _("Wed"), _("Thu"), _("Fri"), _("Sat")],
68
        dayNamesShort: [_("Sun"), _("Mon"), _("Tue"), _("Wed"), _("Thu"), _("Fri"), _("Sat")],
67
        dayNamesMin: [_("Su"),_("Mo"),_("Tu"),_("We"),_("Th"),_("Fr"),_("Sa")],
69
        dayNamesMin: [_("Su"),_("Mo"),_("Tu"),_("We"),_("Th"),_("Fr"),_("Sa")],
68
        weekHeader: _("Wk"),
70
        weekHeader: _("Wk"),
69
        dateFormat: "[% IF ( dateformat == "us" ) %]mm/dd/yy[% ELSIF ( dateformat == "metric" ) %]dd/mm/yy[% ELSE %]yy-mm-dd[% END %]",
71
        dateFormat: "[% IF ( dateformat == "us" ) %]mm/dd/yy[% ELSIF ( dateformat == "metric" ) %]dd/mm/yy[% ELSIF ( dateformat == "dmydot" ) %]dd.mm.yy[% ELSE %]yy-mm-dd[% END %]",
70
        firstDay: [% Koha.Preference('CalendarFirstDayOfWeek') %],
72
        firstDay: [% Koha.Preference('CalendarFirstDayOfWeek') %],
71
        isRTL: [% IF ( bidi ) %]true[% ELSE %]false[% END %],
73
        isRTL: [% IF ( bidi ) %]true[% ELSE %]false[% END %],
72
        showMonthAfterYear: false,
74
        showMonthAfterYear: false,
(-)a/koha-tmpl/intranet-tmpl/prog/en/includes/date-format.inc (-1 / +1 lines)
Line 1 Link Here
1
[% IF ( dateformat == "us" ) %](MM/DD/YYYY)[% ELSIF ( dateformat == "metric" ) %](DD/MM/YYYY)[% ELSE %](YYYY-MM-DD)[% END %]
1
[% 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 (+2 lines)
Lines 160-165 $(document).ready(function() { Link Here
160
              var MSG_DATE_FORMAT = _("Dates of birth should be entered in the format 'YYYY-MM-DD'");
160
              var MSG_DATE_FORMAT = _("Dates of birth should be entered in the format 'YYYY-MM-DD'");
161
          [% ELSIF dateformat == 'metric' %]
161
          [% ELSIF dateformat == 'metric' %]
162
              var MSG_DATE_FORMAT = _("Dates of birth should be entered in the format 'DD/MM/YYYY'");
162
              var MSG_DATE_FORMAT = _("Dates of birth should be entered in the format 'DD/MM/YYYY'");
163
          [% ELSIF dateformat == 'dmydot' %]
164
              var MSG_DATE_FORMAT = _("Dates of birth should be entered in the format 'DD.MM.YYYY'");
163
          [% END %]
165
          [% END %]
164
          $('#searchmember').attr("title",MSG_DATE_FORMAT).tooltip('show');
166
          $('#searchmember').attr("title",MSG_DATE_FORMAT).tooltip('show');
165
      } else {
167
      } else {
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/holidays.tt (-2 / +2 lines)
Lines 260-266 td.repeatableyearly a.ui-state-default { background: #FFCC66 none; color : Bl Link Here
260
                <strong>From date:</strong>
260
                <strong>From date:</strong>
261
                <span id="showDaynameOutput"></span>, 
261
                <span id="showDaynameOutput"></span>, 
262
                
262
                
263
                                [% 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 %]
263
                                [% 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>[% ELSIF ( dateformat == "dmydot") %]<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 %]
264
264
265
                <input type="hidden" id="showDayname" name="showDayname" />
265
                <input type="hidden" id="showDayname" name="showDayname" />
266
                <input type="hidden" id="showWeekday" name="showWeekday" />
266
                <input type="hidden" id="showWeekday" name="showWeekday" />
Lines 331-337 td.repeatableyearly a.ui-state-default { background: #FFCC66 none; color : Bl Link Here
331
                <strong>From date:</strong>
331
                <strong>From date:</strong>
332
                <span id="newDaynameOutput"></span>, 
332
                <span id="newDaynameOutput"></span>, 
333
333
334
                         [% 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 %]
334
                         [% IF ( dateformat == "us" ) %]<span id="newMonthOutput"></span>/<span id="newDayOutput"></span>/<span id="newYearOutput"></span>[% ELSIF ( dateformat == "metric" || dateformat == "dmydot" ) %]<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 %]
335
335
336
                <input type="hidden" id="newDayname" name="showDayname" />
336
                <input type="hidden" id="newDayname" name="showDayname" />
337
                <input type="hidden" id="newWeekday" name="newWeekday" />
337
                <input type="hidden" id="newWeekday" name="newWeekday" />
(-)a/koha-tmpl/opac-tmpl/bootstrap/en/includes/calendar.inc (-2 / +4 lines)
Lines 7-13 Link Here
7
        if (debug > 1) {alert("dateformat: " + dformat + "\ndebug is on (level " + debug + ")");}
7
        if (debug > 1) {alert("dateformat: " + dformat + "\ndebug is on (level " + debug + ")");}
8
8
9
        function Date_from_syspref(dstring) {
9
        function Date_from_syspref(dstring) {
10
                var dateX = dstring.split(/[-/]/);
10
                var dateX = dstring.split(/[-/.]/);
11
                if (debug > 1 && sentmsg < 1) {sentmsg++; alert("Date_from_syspref(" + dstring + ") splits to:\n" + dateX.join("\n"));}
11
                if (debug > 1 && sentmsg < 1) {sentmsg++; alert("Date_from_syspref(" + dstring + ") splits to:\n" + dateX.join("\n"));}
12
                if (dformat === "iso") {
12
                if (dformat === "iso") {
13
                        return new Date(dateX[0], (dateX[1] - 1), dateX[2]);  // YYYY-MM-DD to (YYYY,m(0-11),d)
13
                        return new Date(dateX[0], (dateX[1] - 1), dateX[2]);  // YYYY-MM-DD to (YYYY,m(0-11),d)
Lines 15-20 Link Here
15
                        return new Date(dateX[2], (dateX[0] - 1), dateX[1]);  // MM/DD/YYYY to (YYYY,m(0-11),d)
15
                        return new Date(dateX[2], (dateX[0] - 1), dateX[1]);  // MM/DD/YYYY to (YYYY,m(0-11),d)
16
                } else if (dformat === "metric") {
16
                } else if (dformat === "metric") {
17
                        return new Date(dateX[2], (dateX[1] - 1), dateX[0]);  // DD/MM/YYYY to (YYYY,m(0-11),d)
17
                        return new Date(dateX[2], (dateX[1] - 1), dateX[0]);  // DD/MM/YYYY to (YYYY,m(0-11),d)
18
                } else if (dformat === "dmydot") {
19
                        return new Date(dateX[2], (dateX[1] - 1), dateX[0]);  // DD.MM.YYYY to (YYYY,m(0-11),d)
18
                } else {
20
                } else {
19
                        if (debug > 0) {alert("KOHA ERROR - Unrecognized date format: " +dformat);}
21
                        if (debug > 0) {alert("KOHA ERROR - Unrecognized date format: " +dformat);}
20
                        return 0;
22
                        return 0;
Lines 37-43 Link Here
37
                dayNamesShort: [_("Sun"), _("Mon"), _("Tue"), _("Wed"), _("Thu"), _("Fri"), _("Sat")],
39
                dayNamesShort: [_("Sun"), _("Mon"), _("Tue"), _("Wed"), _("Thu"), _("Fri"), _("Sat")],
38
                dayNamesMin: [_("Su"),_("Mo"),_("Tu"),_("We"),_("Th"),_("Fr"),_("Sa")],
40
                dayNamesMin: [_("Su"),_("Mo"),_("Tu"),_("We"),_("Th"),_("Fr"),_("Sa")],
39
                weekHeader: _("Wk"),
41
                weekHeader: _("Wk"),
40
                dateFormat: '[% IF ( dateformat == "us" ) %]mm/dd/yy[% ELSIF ( dateformat == "metric" ) %]dd/mm/yy[% ELSE %]yy-mm-dd[% END %]',
42
                dateFormat: '[% IF ( dateformat == "us" ) %]mm/dd/yy[% ELSIF ( dateformat == "metric" ) %]dd/mm/yy[% ELSIF ( dateformat == "dmydot" ) %]dd.mm.yy[% ELSE %]yy-mm-dd[% END %]',
41
                firstDay: [% Koha.Preference('CalendarFirstDayOfWeek') %],
43
                firstDay: [% Koha.Preference('CalendarFirstDayOfWeek') %],
42
                isRTL: [% IF ( bidi ) %]true[% ELSE %]false[% END %],
44
                isRTL: [% IF ( bidi ) %]true[% ELSE %]false[% END %],
43
                showMonthAfterYear: false,
45
                showMonthAfterYear: false,
(-)a/tools/holidays.pl (-2 / +4 lines)
Lines 99-105 foreach my $monthDay (keys %$day_month_holidays) { Link Here
99
    if (C4::Context->preference("dateformat") eq "metric") {
99
    if (C4::Context->preference("dateformat") eq "metric") {
100
      $day_monthdate_sort = "$day_month_holidays->{$monthDay}{month}-$day_month_holidays->{$monthDay}{day}";
100
      $day_monthdate_sort = "$day_month_holidays->{$monthDay}{month}-$day_month_holidays->{$monthDay}{day}";
101
      $day_monthdate = "$day_month_holidays->{$monthDay}{day}/$day_month_holidays->{$monthDay}{month}";
101
      $day_monthdate = "$day_month_holidays->{$monthDay}{day}/$day_month_holidays->{$monthDay}{month}";
102
    } elsif (C4::Context->preference("dateformat") eq "us") {
102
    } elsif (C4::Context->preference("dateformat") eq "dmydot") {
103
      $day_monthdate_sort = "$day_month_holidays->{$monthDay}{month}.$day_month_holidays->{$monthDay}{day}";
104
      $day_monthdate = "$day_month_holidays->{$monthDay}{day}.$day_month_holidays->{$monthDay}{month}";
105
    }elsif (C4::Context->preference("dateformat") eq "us") {
103
      $day_monthdate = "$day_month_holidays->{$monthDay}{month}/$day_month_holidays->{$monthDay}{day}";
106
      $day_monthdate = "$day_month_holidays->{$monthDay}{month}/$day_month_holidays->{$monthDay}{day}";
104
      $day_monthdate_sort = $day_monthdate;
107
      $day_monthdate_sort = $day_monthdate;
105
    } else {
108
    } else {
106
- 

Return to bug 12072