File: demos/startbootstrap-sb-admin-2/bower_components/datatables-plugins/sorting/date-euro.js

Recommend this page to a friend!
  Classes of Emmanuel Podvin   Blapy   demos/startbootstrap-sb-admin-2/bower_components/datatables-plugins/sorting/date-euro.js   Download  
File: demos/startbootstrap-sb-admin-2/bower_components/datatables-plugins/sorting/date-euro.js
Role: Auxiliary script
Content type: text/plain
Description: Auxiliary script
Class: Blapy
jQuery plugin to load linked pages using AJAX
Author: By
Last change: Update of demos/startbootstrap-sb-admin-2/bower_components/datatables-plugins/sorting/date-euro.js
Date: 2 years ago
Size: 1,401 bytes
 

Contents

Class file image Download
/** * This plug-in will provide date sorting for the "dd/mm/YYY hh:ii:ss" * formatting, which is common in France and other European countries. It can * also be quickly adapted for other formatting as required. Furthermore, this * date sorting plug-in allows for empty values in the column. * * Please note that this plug-in is **deprecated*. The * [datetime](//datatables.net/blog/2014-12-18) plug-in provides enhanced * functionality and flexibility. * * @name Date (dd/mm/YYY hh:ii:ss) * @summary Sort date / time in the format `dd/mm/YYY hh:ii:ss` * @author [Ronan Guilloux](http://coolforest.net/) * @deprecated * * @example * $('#example').dataTable( { * columnDefs: [ * { type: 'date-euro', targets: 0 } * ] * } ); */ jQuery.extend( jQuery.fn.dataTableExt.oSort, { "date-euro-pre": function ( a ) { var x; if ( $.trim(a) !== '' ) { var frDatea = $.trim(a).split(' '); var frTimea = frDatea[1].split(':'); var frDatea2 = frDatea[0].split('/'); x = (frDatea2[2] + frDatea2[1] + frDatea2[0] + frTimea[0] + frTimea[1] + frTimea[2]) * 1; } else { x = Infinity; } return x; }, "date-euro-asc": function ( a, b ) { return a - b; }, "date-euro-desc": function ( a, b ) { return b - a; } } );