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

(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/holidays.tt (-7 / +31 lines)
Lines 84-103 Link Here
84
		newin=window.open("/cgi-bin/koha/help.pl","KohaHelp",'width=600,height=600,toolbar=false,scrollbars=yes');
84
		newin=window.open("/cgi-bin/koha/help.pl","KohaHelp",'width=600,height=600,toolbar=false,scrollbars=yes');
85
	}
85
	}
86
	$(document).ready(function() {
86
	$(document).ready(function() {
87
88
[% IF ( dateformat_metric ) %]		$.tablesorter.addParser({ // http://tablesorter.com/docs/example-parsers.html
89
			id: 'shortDates',
90
			is: function(s){
91
				return false;
92
			},
93
			format: function(s){
94
				var datepattern = new RegExp("[0-9]\/[0-9]");
95
				if( datepattern.test(s)){ // sorting a date without a year: "01/12"
96
					var dateparts = s.split("/").reverse().join("-"); // build an ISO date to be sorted as text
97
					s = "2000-" + dateparts; // use 2000 as the default year
98
				}
99
				return s;
100
			},
101
			type: 'text'
102
		});
103
[% END %]
87
		$(".hint").hide();
104
		$(".hint").hide();
88
		$("#branch").change(function(){
105
		$("#branch").change(function(){
89
			changeBranch();
106
			changeBranch();
90
		});
107
		});
91
		$("#holidayexceptions").tablesorter({
108
		$("#holidayexceptions").tablesorter({[% IF ( dateformat_metric ) %]
109
		  dateFormat: 'uk',[% END %]
92
		  sortList: [[0,0]], widgets: ['zebra']
110
		  sortList: [[0,0]], widgets: ['zebra']
93
		});
111
		});
94
		$("#holidayweeklyrepeatable").tablesorter({
112
		$("#holidayweeklyrepeatable").tablesorter({[% IF ( dateformat_metric ) %]
113
		  dateFormat: 'uk',[% END %]
95
		  sortList: [[0,0]], widgets: ['zebra']
114
		  sortList: [[0,0]], widgets: ['zebra']
96
		});
115
		});
97
		$("#holidaysyearlyrepeatable").tablesorter({
116
		$("#holidaysyearlyrepeatable").tablesorter({[% IF ( dateformat_metric ) %]
98
		  sortList: [[0,0]], widgets: ['zebra']
117
			headers : {
118
				0: {
119
					sorter : 'shortDates'
120
				}
121
			},[% END %]
122
			sortList: [[0,0]], widgets: ['zebra']
99
		});
123
		});
100
		$("#holidaysunique").tablesorter({
124
		$("#holidaysunique").tablesorter({[% IF ( dateformat_metric ) %]
125
		  dateFormat: 'uk',[% END %]
101
		  sortList: [[0,0]], widgets: ['zebra']
126
		  sortList: [[0,0]], widgets: ['zebra']
102
		});
127
		});
103
		$("a.helptext").click(function(){
128
		$("a.helptext").click(function(){
Lines 438-444 Link Here
438
<table id="holidaysyearlyrepeatable">
463
<table id="holidaysyearlyrepeatable">
439
<thead>
464
<thead>
440
<tr>
465
<tr>
441
  [% IF ( dateformat == 'metric' ) %]
466
  [% IF ( dateformat_metric ) %]
442
  <th class="repeatableyearly">Day/Month</th>
467
  <th class="repeatableyearly">Day/Month</th>
443
  [% ELSE %]
468
  [% ELSE %]
444
  <th class="repeatableyearly">Month/Day</th>
469
  <th class="repeatableyearly">Month/Day</th>
445
- 

Return to bug 3806