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

(-)a/koha-tmpl/intranet-tmpl/prog/en/js/datatables.js (-41 lines)
Lines 160-205 function dt_add_rangedate_filter(begindate_id, enddate_id, dateCol) { Link Here
160
    );
160
    );
161
}
161
}
162
162
163
//Sorting for dates (uk format)
164
function dt_add_type_uk_date() {
165
  jQuery.fn.dataTableExt.aTypes.unshift(
166
    function ( sData )
167
    {
168
      if (sData.match(/(0[1-9]|[12][0-9]|3[01])\/(0[1-9]|1[012])\/(19|20|21)\d\d/))
169
      {
170
        return 'uk_date';
171
      }
172
      return null;
173
    }
174
  );
175
176
  jQuery.fn.dataTableExt.oSort['uk_date-asc']  = function(a,b) {
177
    var re = /(\d{2}\/\d{2}\/\d{4})/;
178
    a.match(re);
179
    var ukDatea = RegExp.$1.split("/");
180
    b.match(re);
181
    var ukDateb = RegExp.$1.split("/");
182
183
    var x = (ukDatea[2] + ukDatea[1] + ukDatea[0]) * 1;
184
    var y = (ukDateb[2] + ukDateb[1] + ukDateb[0]) * 1;
185
186
    return ((x < y) ? -1 : ((x > y) ?  1 : 0));
187
  };
188
189
  jQuery.fn.dataTableExt.oSort['uk_date-desc'] = function(a,b) {
190
    var re = /(\d{2}\/\d{2}\/\d{4})/;
191
    a.match(re);
192
    var ukDatea = RegExp.$1.split("/");
193
    b.match(re);
194
    var ukDateb = RegExp.$1.split("/");
195
196
    var x = (ukDatea[2] + ukDatea[1] + ukDatea[0]) * 1;
197
    var y = (ukDateb[2] + ukDateb[1] + ukDateb[0]) * 1;
198
199
    return ((x < y) ? 1 : ((x > y) ?  -1 : 0));
200
  };
201
}
202
203
// Sorting on html contains
163
// Sorting on html contains
204
// <a href="foo.pl">bar</a> sort on 'bar'
164
// <a href="foo.pl">bar</a> sort on 'bar'
205
function dt_overwrite_html_sorting_localeCompare() {
165
function dt_overwrite_html_sorting_localeCompare() {
206
- 

Return to bug 12089