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

(-)a/C4/Auth.pm (-10 / +1 lines)
Lines 301-316 sub get_template_and_user { Link Here
301
     }
301
     }
302
302
303
    if(C4::Context->preference('dateformat')){
303
    if(C4::Context->preference('dateformat')){
304
        $template->param( dateformat => C4::Context->preference('dateformat') );
304
        $template->param(dateformat => C4::Context->preference('dateformat'))
305
        if(C4::Context->preference('dateformat') eq "metric"){
306
            $template->param(dateformat_metric => 1);
307
        } elsif(C4::Context->preference('dateformat') eq "us"){
308
            $template->param(dateformat_us => 1);
309
        } else {
310
            $template->param(dateformat_iso => 1);
311
        }
312
    } else {
313
        $template->param(dateformat_iso => 1);
314
    }
305
    }
315
306
316
    # these template parameters are set the same regardless of $in->{'type'}
307
    # these template parameters are set the same regardless of $in->{'type'}
(-)a/acqui/newordersubscription.pl (-1 lines)
Lines 102-107 $template->param( Link Here
102
    basketno         => $basket->{basketno},
102
    basketno         => $basket->{basketno},
103
    basketname       => $basket->{basketname},
103
    basketname       => $basket->{basketname},
104
    booksellername   => $bookseller->{name},
104
    booksellername   => $bookseller->{name},
105
    dateformat       => C4::Context->preference("dateformat"),
106
);
105
);
107
output_html_with_http_headers $query, $cookie, $template->output;
106
output_html_with_http_headers $query, $cookie, $template->output;
(-)a/admin/aqbudgets.pl (-1 lines)
Lines 217-223 if ($op eq 'add_form') { Link Here
217
    # if no buget_id is passed then its an add
217
    # if no buget_id is passed then its an add
218
    $template->param(
218
    $template->param(
219
        add_validate                  => 1,
219
        add_validate                  => 1,
220
        dateformat                => C4::Dates->new()->visual(),
221
        budget_parent_id    		  => $budget_parent->{'budget_id'},
220
        budget_parent_id    		  => $budget_parent->{'budget_id'},
222
        budget_parent_name    		  => $budget_parent->{'budget_name'},
221
        budget_parent_name    		  => $budget_parent->{'budget_name'},
223
        branchloop_select         => \@branchloop_select,
222
        branchloop_select         => \@branchloop_select,
(-)a/koha-tmpl/intranet-tmpl/prog/en/includes/calendar.inc (-2 / +2 lines)
Lines 37-43 jQuery(function($){ Link Here
37
        dayNamesShort: [_("Sun"), _("Mon"), _("Tue"), _("Wed"), _("Thu"), _("Fri"), _("Sat")],
37
        dayNamesShort: [_("Sun"), _("Mon"), _("Tue"), _("Wed"), _("Thu"), _("Fri"), _("Sat")],
38
        dayNamesMin: [_("Su"),_("Mo"),_("Tu"),_("We"),_("Th"),_("Fr"),_("Sa")],
38
        dayNamesMin: [_("Su"),_("Mo"),_("Tu"),_("We"),_("Th"),_("Fr"),_("Sa")],
39
        weekHeader: _("Wk"),
39
        weekHeader: _("Wk"),
40
        dateFormat: '[% IF ( dateformat_us ) %]mm/dd/yy[% ELSIF ( dateformat_metric ) %]dd/mm/yy[% ELSE %]yy-mm-dd[% END %]',
40
        dateFormat: "[% IF ( dateformat == "us" ) %]mm/dd/yy[% ELSIF ( dateformat == "metric" ) %]dd/mm/yy[% ELSE %]yy-mm-dd[% END %]",
41
        firstDay: [% CalendarFirstDayOfWeek %],
41
        firstDay: [% CalendarFirstDayOfWeek %],
42
        isRTL: [% IF ( bidi ) %]true[% ELSE %]false[% END %],
42
        isRTL: [% IF ( bidi ) %]true[% ELSE %]false[% END %],
43
        showMonthAfterYear: false,
43
        showMonthAfterYear: false,
Lines 75-78 $.datepicker.setDefaults({ Link Here
75
    });
75
    });
76
});
76
});
77
//]]>
77
//]]>
78
</script>
78
</script>
(-)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)[% ELSE %](YYYY-MM-DD)[% END %]
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/members/memberentrygen.tt (-8 / +8 lines)
Lines 274-285 Link Here
274
                <label for="dateofbirth">
274
                <label for="dateofbirth">
275
                [% END %]
275
                [% END %]
276
                Date of birth: </label>
276
                Date of birth: </label>
277
				
277
278
	[% IF ( metric ) %]			
278
        [% IF ( dateformat == "metric" ) %]
279
                <input type="text" id="dateofbirth" name="dateofbirth" size="20" onchange="CheckDate(document.form.dateofbirth);" value="[% IF ( opduplicate ) %][% ELSE %][% dateofbirth %][% END %]" />
279
                <input type="text" id="dateofbirth" name="dateofbirth" size="20" onchange="CheckDate(document.form.dateofbirth);" value="[% IF ( opduplicate ) %][% ELSE %][% dateofbirth %][% END %]" />
280
[% ELSE %]
280
        [% ELSE %]
281
                <input type="text" id="dateofbirth" name="dateofbirth" size="20" value="[% IF ( opduplicate ) %][% ELSE %][% dateofbirth %][% END %]" />
281
                <input type="text" id="dateofbirth" name="dateofbirth" size="20" value="[% IF ( opduplicate ) %][% ELSE %][% dateofbirth %][% END %]" />
282
[% END %]
282
        [% END %]
283
283
284
        [% IF ( mandatorydateofbirth ) %]<span class="required">Required</span>[% END %]
284
        [% IF ( mandatorydateofbirth ) %]<span class="required">Required</span>[% END %]
285
        [% IF ( ERROR_dateofbirth ) %]<span class="required">(Error)</span>[% END %]
285
        [% IF ( ERROR_dateofbirth ) %]<span class="required">(Error)</span>[% END %]
Lines 1087-1097 Link Here
1087
            <label for="from">
1087
            <label for="from">
1088
			[% END %]
1088
			[% END %]
1089
			Registration date: </label>
1089
			Registration date: </label>
1090
			[% IF ( metric ) %]
1090
            [% IF ( dateformat == "metric" ) %]
1091
                <input type="text" id="from" name="dateenrolled"  maxlength="10" size="10" onchange="CheckDate(document.form.dateenrolled);check_manip_date('verify');" value="[% dateenrolled %]" class="datepickerfrom" />
1091
                <input type="text" id="from" name="dateenrolled"  maxlength="10" size="10" onchange="CheckDate(document.form.dateenrolled);check_manip_date('verify');" value="[% dateenrolled %]" class="datepickerfrom" />
1092
			[% ELSE %]
1092
            [% ELSE %]
1093
                <input type="text" id="from" name="dateenrolled"  maxlength="10" size="10" value="[% dateenrolled %]" class="datepickerfrom" />
1093
                <input type="text" id="from" name="dateenrolled"  maxlength="10" size="10" value="[% dateenrolled %]" class="datepickerfrom" />
1094
			[% END %]
1094
            [% END %]
1095
		[% IF ( mandatorydateenrolled ) %]<span class="required">Required</span>[% END %]
1095
		[% IF ( mandatorydateenrolled ) %]<span class="required">Required</span>[% END %]
1096
		[% IF ( ERROR_dateenrolled ) %]<span class="required">(Error)</span>[% END %]
1096
		[% IF ( ERROR_dateenrolled ) %]<span class="required">(Error)</span>[% END %]
1097
		<div class="hint">[% INCLUDE 'date-format.inc' %]</div>
1097
		<div class="hint">[% INCLUDE 'date-format.inc' %]</div>
Lines 1108-1114 Link Here
1108
            <label for="to">
1108
            <label for="to">
1109
			[% END %]
1109
			[% END %]
1110
			Expiry date (leave blank for auto calc) </label>
1110
			Expiry date (leave blank for auto calc) </label>
1111
			[% IF ( metric ) %]
1111
            [% IF ( dateformat == "metric" ) %]
1112
				[% UNLESS ( opadd ) %]
1112
				[% UNLESS ( opadd ) %]
1113
                    <input type="text" id="to" name="dateexpiry" maxlength="10"  size="10" onchange="CheckDate(document.form.dateexpiry);check_manip_date('verify');" value="[% dateexpiry %]" class="datepickerto" />
1113
                    <input type="text" id="to" name="dateexpiry" maxlength="10"  size="10" onchange="CheckDate(document.form.dateexpiry);check_manip_date('verify');" value="[% dateexpiry %]" class="datepickerto" />
1114
				[% ELSE %]
1114
				[% ELSE %]
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/serials/serials-collection.tt (-1 / +1 lines)
Lines 59-65 function CheckNone( node ) { Link Here
59
}
59
}
60
$(document).ready(function() {
60
$(document).ready(function() {
61
    $('#subscription_years').tabs();
61
    $('#subscription_years').tabs();
62
    [% IF dateformatmetric %]
62
    [% IF dateformat == "metric" %]
63
      dt_add_type_uk_date();
63
      dt_add_type_uk_date();
64
    [% END %]
64
    [% END %]
65
65
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/serials/subscription-add.tt (-3 / +3 lines)
Lines 23-35 function formatDate(myDate) { Link Here
23
    var d = new Array( myDate.getFullYear(), myDate.getMonth() + 1 ,myDate.getDate());
23
    var d = new Array( myDate.getFullYear(), myDate.getMonth() + 1 ,myDate.getDate());
24
    if(d[1].toString().length == 1) { d[1] = '0'+d[1] };
24
    if(d[1].toString().length == 1) { d[1] = '0'+d[1] };
25
    if(d[2].toString().length == 1) { d[2] = '0'+d[2] };
25
    if(d[2].toString().length == 1) { d[2] = '0'+d[2] };
26
    [% IF ( dateformat_us ) %]
26
    [% IF ( dateformat == "us" ) %]
27
        return(d[1] + '/' + d[2] + '/' + d[0]) ;
27
        return(d[1] + '/' + d[2] + '/' + d[0]) ;
28
    [% ELSIF ( dateformat_metric ) %]
28
    [% ELSIF ( dateformat == "metric" ) %]
29
        return(d[2] + '/' + d[1] + '/' + d[0]) ;
29
        return(d[2] + '/' + d[1] + '/' + d[0]) ;
30
    [% ELSE %]
30
    [% ELSE %]
31
        return(''+d[0] + '-' + d[1] + '-' + d[2]) ;
31
        return(''+d[0] + '-' + d[1] + '-' + d[2]) ;
32
    [% END %]    
32
    [% END %]
33
}
33
}
34
34
35
Date.prototype.addDays = function(days) {
35
Date.prototype.addDays = function(days) {
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/holidays.tt (-3 / +3 lines)
Lines 259-265 td.repeatableyearly a.ui-state-default { background: #FFFF99 none; color : Bl Link Here
259
				<strong>From Date:</strong>
259
				<strong>From Date:</strong>
260
				<span id="showDaynameOutput"></span>, 
260
				<span id="showDaynameOutput"></span>, 
261
				
261
				
262
				[% 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 %]
262
                                [% 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
263
264
				<input type="hidden" id="showDayname" name="showDayname" />
264
				<input type="hidden" id="showDayname" name="showDayname" />
265
				<input type="hidden" id="showWeekday" name="showWeekday" />
265
				<input type="hidden" id="showWeekday" name="showWeekday" />
Lines 329-335 td.repeatableyearly a.ui-state-default { background: #FFFF99 none; color : Bl Link Here
329
                <strong>From date:</strong>
329
                <strong>From date:</strong>
330
				<span id="newDaynameOutput"></span>, 
330
				<span id="newDaynameOutput"></span>, 
331
331
332
				[% 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 %]
332
                         [% 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 %]
333
333
334
				<input type="hidden" id="newDayname" name="showDayname" />
334
				<input type="hidden" id="newDayname" name="showDayname" />
335
				<input type="hidden" id="newWeekday" name="newWeekday" />
335
				<input type="hidden" id="newWeekday" name="newWeekday" />
Lines 483-489 td.repeatableyearly a.ui-state-default { background: #FFFF99 none; color : Bl Link Here
483
<table id="holidaysyearlyrepeatable">
483
<table id="holidaysyearlyrepeatable">
484
<thead>
484
<thead>
485
<tr>
485
<tr>
486
  [% IF ( dateformat_metric ) %]
486
  [% IF ( dateformat == "metric" ) %]
487
  <th class="repeatableyearly">Day/Month</th>
487
  <th class="repeatableyearly">Day/Month</th>
488
  [% ELSE %]
488
  [% ELSE %]
489
  <th class="repeatableyearly">Month/Day</th>
489
  <th class="repeatableyearly">Month/Day</th>
(-)a/koha-tmpl/opac-tmpl/prog/en/includes/calendar.inc (-1 / +1 lines)
Lines 37-43 jQuery(function($){ Link Here
37
        dayNamesShort: [_("Sun"), _("Mon"), _("Tue"), _("Wed"), _("Thu"), _("Fri"), _("Sat")],
37
        dayNamesShort: [_("Sun"), _("Mon"), _("Tue"), _("Wed"), _("Thu"), _("Fri"), _("Sat")],
38
        dayNamesMin: [_("Su"),_("Mo"),_("Tu"),_("We"),_("Th"),_("Fr"),_("Sa")],
38
        dayNamesMin: [_("Su"),_("Mo"),_("Tu"),_("We"),_("Th"),_("Fr"),_("Sa")],
39
        weekHeader: _("Wk"),
39
        weekHeader: _("Wk"),
40
        dateFormat: '[% IF ( dateformat_us ) %]mm/dd/yy[% ELSIF ( dateformat_metric ) %]dd/mm/yy[% ELSE %]yy-mm-dd[% END %]',
40
        dateFormat: '[% IF ( dateformat == "us" ) %]mm/dd/yy[% ELSIF ( dateformat == "metric" ) %]dd/mm/yy[% ELSE %]yy-mm-dd[% END %]',
41
        firstDay: [% CalendarFirstDayOfWeek %],
41
        firstDay: [% CalendarFirstDayOfWeek %],
42
        isRTL: [% IF ( bidi ) %]true[% ELSE %]false[% END %],
42
        isRTL: [% IF ( bidi ) %]true[% ELSE %]false[% END %],
43
        showMonthAfterYear: false,
43
        showMonthAfterYear: false,
(-)a/koha-tmpl/opac-tmpl/prog/en/modules/sco/sco-main.tt (-1 / +1 lines)
Lines 75-81 $(document).ready(function() { Link Here
75
    dofocus();
75
    dofocus();
76
    [% IF ( patronid ) %]sco_init();[% END %]
76
    [% IF ( patronid ) %]sco_init();[% END %]
77
    $("#loanTable").tablesorter({
77
    $("#loanTable").tablesorter({
78
        [% IF ( dateformat_metric ) %]
78
        [% IF ( dateformat == "metric" ) %]
79
            dateFormat: 'uk',
79
            dateFormat: 'uk',
80
        [% END %]
80
        [% END %]
81
        widgets:   ['zebra'],
81
        widgets:   ['zebra'],
(-)a/members/memberentry.pl (-2 lines)
Lines 711-718 $template->param( Link Here
711
  borrotitlepopup => $borrotitlepopup,
711
  borrotitlepopup => $borrotitlepopup,
712
  guarantorinfo   => $guarantorinfo,
712
  guarantorinfo   => $guarantorinfo,
713
  flagloop  => \@flagdata,
713
  flagloop  => \@flagdata,
714
  dateformat      => C4::Dates->new()->visual(),
715
  C4::Context->preference('dateformat') => 1,
716
  check_categorytype =>$check_categorytype,#to recover the category type with checkcategorytype function
714
  check_categorytype =>$check_categorytype,#to recover the category type with checkcategorytype function
717
  category_type =>$category_type,
715
  category_type =>$category_type,
718
  modify          => $modify,
716
  modify          => $modify,
(-)a/reports/guided_reports.pl (-1 lines)
Lines 105-111 elsif ( $phase eq 'Build new' ) { Link Here
105
        'savedreports' => get_saved_reports($filter),
105
        'savedreports' => get_saved_reports($filter),
106
        'usecache' => $usecache,
106
        'usecache' => $usecache,
107
        'groups_with_subgroups'=> groups_with_subgroups($group, $subgroup),
107
        'groups_with_subgroups'=> groups_with_subgroups($group, $subgroup),
108
        dateformat => C4::Context->preference('dateformat'),
109
    );
108
    );
110
}
109
}
111
110
(-)a/serials/serials-collection.pl (-2 lines)
Lines 172-178 $template->param( Link Here
172
          callnumber	       => $callnumber,
172
          callnumber	       => $callnumber,
173
          uc(C4::Context->preference("marcflavour")) => 1,
173
          uc(C4::Context->preference("marcflavour")) => 1,
174
          serialsadditems   => $subscriptiondescs->[0]{'serialsadditems'},
174
          serialsadditems   => $subscriptiondescs->[0]{'serialsadditems'},
175
          dateformatmetric   => C4::Context->preference("dateformat") eq "metric" ? 1 : 0,
176
          );
175
          );
177
176
178
output_html_with_http_headers $query, $cookie, $template->output;
177
output_html_with_http_headers $query, $cookie, $template->output;
179
- 

Return to bug 9508