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/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/circ/circulation.tt (-14 / +22 lines)
Lines 25-39 Link Here
25
	 $(document).ready(function() {
25
	 $(document).ready(function() {
26
26
27
        $('#patronlists').tabs();
27
        $('#patronlists').tabs();
28
		[% IF ( UseTablesortForCirc ) %]$.tablesorter.defaults.widgets = ['zebra'];
28
        [% IF ( UseTablesortForCirc ) %]
29
		$("#issuest").tablesorter({[% IF ( dateformat_metric ) %]
29
            $.tablesorter.defaults.widgets = ['zebra'];
30
		dateFormat: 'uk',[% END %]
30
            $("#issuest").tablesorter({
31
		headers: { 1: { sorter: 'articles' },6: { sorter: false },7:{sorter:false},8:{sorter:false},9:{sorter:false}}
31
                [% IF ( dateformat == "metric" ) %]
32
		});
32
                    dateFormat: 'uk',
33
		$("#relissuest").tablesorter({[% IF ( dateformat_metric ) %]
33
                [% END %]
34
		dateFormat: 'uk',[% END %]
34
                headers: { 1: { sorter: 'articles' },6: { sorter: false },7:{sorter:false},8:{sorter:false},9:{sorter:false}}
35
		headers: { 1: { sorter: 'articles' },6: { sorter: false },7:{sorter:false},8:{sorter:false},9:{sorter:false}}
35
            });
36
		});
36
            $("#relissuest").tablesorter({
37
                [% IF ( dateformat == "metric" ) %]
38
                    dateFormat: 'uk',
39
                [% END %]
40
                headers: { 1: { sorter: 'articles' },6: { sorter: false },7:{sorter:false},8:{sorter:false},9:{sorter:false}}
41
            });
37
42
38
		//FIXME: Sorting does not work when there are previous checkouts only
43
		//FIXME: Sorting does not work when there are previous checkouts only
39
		// (It works fine when there are only checkouts of the day, or both previous and today checkouts)
44
		// (It works fine when there are only checkouts of the day, or both previous and today checkouts)
Lines 43-53 Link Here
43
		$("#relissuest").bind("sortEnd",function() {
48
		$("#relissuest").bind("sortEnd",function() {
44
		    $("#relprevious").parents("tr").remove();  // 'previous checkouts' header chokes table sorter
49
		    $("#relprevious").parents("tr").remove();  // 'previous checkouts' header chokes table sorter
45
		});
50
		});
46
		$("#holdst").tablesorter({[% IF ( dateformat_metric ) %]
51
            $("#holdst").tablesorter({
47
		dateFormat: 'uk',[% END %]
52
                [% IF ( dateformat == "metric" ) %]
48
			sortList: [[0,0]],
53
                    dateFormat: 'uk',
49
			headers: { 1: { sorter: 'articles' },5: { sorter: false }}
54
                [% END %]
50
		});[% END %]
55
                sortList: [[0,0]],
56
                headers: { 1: { sorter: 'articles' },5: { sorter: false }}
57
            });
58
        [% END %]
51
        [% IF ( AllowRenewalLimitOverride ) %]
59
        [% IF ( AllowRenewalLimitOverride ) %]
52
        $( '#override_limit' ).click( function () {
60
        $( '#override_limit' ).click( function () {
53
            if ( this.checked ) {
61
            if ( this.checked ) {
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/members/memberentrygen.tt (-8 / +8 lines)
Lines 273-284 Link Here
273
                <label for="dateofbirth">
273
                <label for="dateofbirth">
274
                [% END %]
274
                [% END %]
275
                Date of birth: </label>
275
                Date of birth: </label>
276
				
276
277
	[% IF ( metric ) %]			
277
        [% IF ( dateformat == "metric" ) %]
278
                <input type="text" id="dateofbirth" name="dateofbirth" size="20" onchange="CheckDate(document.form.dateofbirth);" value="[% IF ( opduplicate ) %][% ELSE %][% dateofbirth %][% END %]" />
278
                <input type="text" id="dateofbirth" name="dateofbirth" size="20" onchange="CheckDate(document.form.dateofbirth);" value="[% IF ( opduplicate ) %][% ELSE %][% dateofbirth %][% END %]" />
279
[% ELSE %]
279
        [% ELSE %]
280
                <input type="text" id="dateofbirth" name="dateofbirth" size="20" value="[% IF ( opduplicate ) %][% ELSE %][% dateofbirth %][% END %]" />
280
                <input type="text" id="dateofbirth" name="dateofbirth" size="20" value="[% IF ( opduplicate ) %][% ELSE %][% dateofbirth %][% END %]" />
281
[% END %]
281
        [% END %]
282
282
283
        [% IF ( mandatorydateofbirth ) %]<span class="required">Required</span>[% END %]
283
        [% IF ( mandatorydateofbirth ) %]<span class="required">Required</span>[% END %]
284
        [% IF ( ERROR_dateofbirth ) %]<span class="required">(Error)</span>[% END %]
284
        [% IF ( ERROR_dateofbirth ) %]<span class="required">(Error)</span>[% END %]
Lines 1083-1093 Link Here
1083
            <label for="from">
1083
            <label for="from">
1084
			[% END %]
1084
			[% END %]
1085
			Registration date: </label>
1085
			Registration date: </label>
1086
			[% IF ( metric ) %]
1086
            [% IF ( dateformat == "metric" ) %]
1087
                <input type="text" id="from" name="dateenrolled"  maxlength="10" size="10" onchange="CheckDate(document.form.dateenrolled);check_manip_date('verify');" value="[% dateenrolled %]" class="datepickerfrom" />
1087
                <input type="text" id="from" name="dateenrolled"  maxlength="10" size="10" onchange="CheckDate(document.form.dateenrolled);check_manip_date('verify');" value="[% dateenrolled %]" class="datepickerfrom" />
1088
			[% ELSE %]
1088
            [% ELSE %]
1089
                <input type="text" id="from" name="dateenrolled"  maxlength="10" size="10" value="[% dateenrolled %]" class="datepickerfrom" />
1089
                <input type="text" id="from" name="dateenrolled"  maxlength="10" size="10" value="[% dateenrolled %]" class="datepickerfrom" />
1090
			[% END %]
1090
            [% END %]
1091
		[% IF ( mandatorydateenrolled ) %]<span class="required">Required</span>[% END %]
1091
		[% IF ( mandatorydateenrolled ) %]<span class="required">Required</span>[% END %]
1092
		[% IF ( ERROR_dateenrolled ) %]<span class="required">(Error)</span>[% END %]
1092
		[% IF ( ERROR_dateenrolled ) %]<span class="required">(Error)</span>[% END %]
1093
		<div class="hint">[% INCLUDE 'date-format.inc' %]</div>
1093
		<div class="hint">[% INCLUDE 'date-format.inc' %]</div>
Lines 1104-1110 Link Here
1104
            <label for="to">
1104
            <label for="to">
1105
			[% END %]
1105
			[% END %]
1106
			Expiry date (leave blank for auto calc) </label>
1106
			Expiry date (leave blank for auto calc) </label>
1107
			[% IF ( metric ) %]
1107
            [% IF ( dateformat == "metric" ) %]
1108
				[% UNLESS ( opadd ) %]
1108
				[% UNLESS ( opadd ) %]
1109
                    <input type="text" id="to" name="dateexpiry" maxlength="10"  size="10" onchange="CheckDate(document.form.dateexpiry);check_manip_date('verify');" value="[% dateexpiry %]" class="datepickerto" />
1109
                    <input type="text" id="to" name="dateexpiry" maxlength="10"  size="10" onchange="CheckDate(document.form.dateexpiry);check_manip_date('verify');" value="[% dateexpiry %]" class="datepickerto" />
1110
				[% ELSE %]
1110
				[% 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 (-8 / +8 lines)
Lines 153-159 Link Here
153
153
154
	$(document).ready(function() {
154
	$(document).ready(function() {
155
155
156
[% IF ( dateformat_metric ) %]		$.tablesorter.addParser({ // http://tablesorter.com/docs/example-parsers.html
156
[% IF ( dateformat == "metric" ) %]		$.tablesorter.addParser({ // http://tablesorter.com/docs/example-parsers.html
157
			id: 'shortDates',
157
			id: 'shortDates',
158
			is: function(s){
158
			is: function(s){
159
				return false;
159
				return false;
Lines 173-187 Link Here
173
		$("#branch").change(function(){
173
		$("#branch").change(function(){
174
			changeBranch();
174
			changeBranch();
175
		});
175
		});
176
		$("#holidayexceptions").tablesorter({[% IF ( dateformat_metric ) %]
176
             $("#holidayexceptions").tablesorter({[% IF ( dateformat == "metric" ) %]
177
		  dateFormat: 'uk',[% END %]
177
		  dateFormat: 'uk',[% END %]
178
		  sortList: [[0,0]], widgets: ['zebra']
178
		  sortList: [[0,0]], widgets: ['zebra']
179
		});
179
		});
180
		$("#holidayweeklyrepeatable").tablesorter({[% IF ( dateformat_metric ) %]
180
                $("#holidayweeklyrepeatable").tablesorter({[% IF ( dateformat == "metric" ) %]
181
		  dateFormat: 'uk',[% END %]
181
		  dateFormat: 'uk',[% END %]
182
		  sortList: [[0,0]], widgets: ['zebra']
182
		  sortList: [[0,0]], widgets: ['zebra']
183
		});
183
		});
184
		$("#holidaysyearlyrepeatable").tablesorter({[% IF ( dateformat_metric ) %]
184
          $("#holidaysyearlyrepeatable").tablesorter({[% IF ( dateformat == "metric" ) %]
185
			headers : {
185
			headers : {
186
				0: {
186
				0: {
187
					sorter : 'shortDates'
187
					sorter : 'shortDates'
Lines 189-195 Link Here
189
			},[% END %]
189
			},[% END %]
190
			sortList: [[0,0]], widgets: ['zebra']
190
			sortList: [[0,0]], widgets: ['zebra']
191
		});
191
		});
192
		$("#holidaysunique").tablesorter({[% IF ( dateformat_metric ) %]
192
          $("#holidaysunique").tablesorter({[% IF ( dateformat == "metric" ) %]
193
		  dateFormat: 'uk',[% END %]
193
		  dateFormat: 'uk',[% END %]
194
		  sortList: [[0,0]], widgets: ['zebra']
194
		  sortList: [[0,0]], widgets: ['zebra']
195
		});
195
		});
Lines 281-287 td.repeatableyearly a.ui-state-default, .repeatableyearly { background: #FFFF9 Link Here
281
				<strong>From Date:</strong>
281
				<strong>From Date:</strong>
282
				<span id="showDaynameOutput"></span>, 
282
				<span id="showDaynameOutput"></span>, 
283
				
283
				
284
				[% 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 %]
284
                                [% 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 %]
285
285
286
				<input type="hidden" id="showDayname" name="showDayname" />
286
				<input type="hidden" id="showDayname" name="showDayname" />
287
				<input type="hidden" id="showWeekday" name="showWeekday" />
287
				<input type="hidden" id="showWeekday" name="showWeekday" />
Lines 351-357 td.repeatableyearly a.ui-state-default, .repeatableyearly { background: #FFFF9 Link Here
351
                <strong>From date:</strong>
351
                <strong>From date:</strong>
352
				<span id="newDaynameOutput"></span>, 
352
				<span id="newDaynameOutput"></span>, 
353
353
354
				[% 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 %]
354
                         [% 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 %]
355
355
356
				<input type="hidden" id="newDayname" name="showDayname" />
356
				<input type="hidden" id="newDayname" name="showDayname" />
357
				<input type="hidden" id="newWeekday" name="newWeekday" />
357
				<input type="hidden" id="newWeekday" name="newWeekday" />
Lines 505-511 td.repeatableyearly a.ui-state-default, .repeatableyearly { background: #FFFF9 Link Here
505
<table id="holidaysyearlyrepeatable">
505
<table id="holidaysyearlyrepeatable">
506
<thead>
506
<thead>
507
<tr>
507
<tr>
508
  [% IF ( dateformat_metric ) %]
508
  [% IF ( dateformat == "metric" ) %]
509
  <th class="repeatableyearly">Day/Month</th>
509
  <th class="repeatableyearly">Day/Month</th>
510
  [% ELSE %]
510
  [% ELSE %]
511
  <th class="repeatableyearly">Month/Day</th>
511
  <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 700-707 $template->param( Link Here
700
  borrotitlepopup => $borrotitlepopup,
700
  borrotitlepopup => $borrotitlepopup,
701
  guarantorinfo   => $guarantorinfo,
701
  guarantorinfo   => $guarantorinfo,
702
  flagloop  => \@flagdata,
702
  flagloop  => \@flagdata,
703
  dateformat      => C4::Dates->new()->visual(),
704
  C4::Context->preference('dateformat') => 1,
705
  check_categorytype =>$check_categorytype,#to recover the category type with checkcategorytype function
703
  check_categorytype =>$check_categorytype,#to recover the category type with checkcategorytype function
706
  category_type =>$category_type,
704
  category_type =>$category_type,
707
  modify          => $modify,
705
  modify          => $modify,
(-)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