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

Recommend this page to a friend!
  Classes of Emmanuel Podvin   Blapy   demos/startbootstrap-sb-admin-2/bower_components/datatables-plugins/sorting/date-eu.js   Download  
File: demos/startbootstrap-sb-admin-2/bower_components/datatables-plugins/sorting/date-eu.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-eu.js
Date: 2 years ago
Size: 1,564 bytes
 

Contents

Class file image Download
/** * Similar to the Date (dd/mm/YY) data sorting plug-in, this plug-in offers * additional flexibility with support for spaces between the values and * either . or / notation for the separators. * * 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[ . YYYY]) * @summary Sort dates in the format `dd/mm/YY[YY]` (with optional spaces) * @author [Robert Sedov?ek](http://galjot.si/) * @deprecated * * @example * $('#example').dataTable( { * columnDefs: [ * { type: 'date-eu', targets: 0 } * ] * } ); */ jQuery.extend( jQuery.fn.dataTableExt.oSort, { "date-eu-pre": function ( date ) { date = date.replace(" ", ""); var eu_date, year; if (date == '') { return 0; } if (date.indexOf('.') > 0) { /*date a, format dd.mn.(yyyy) ; (year is optional)*/ eu_date = date.split('.'); } else { /*date a, format dd/mn/(yyyy) ; (year is optional)*/ eu_date = date.split('/'); } /*year (optional)*/ if (eu_date[2]) { year = eu_date[2]; } else { year = 0; } /*month*/ var month = eu_date[1]; if (month.length == 1) { month = 0+month; } /*day*/ var day = eu_date[0]; if (day.length == 1) { day = 0+day; } return (year + month + day) * 1; }, "date-eu-asc": function ( a, b ) { return ((a < b) ? -1 : ((a > b) ? 1 : 0)); }, "date-eu-desc": function ( a, b ) { return ((a < b) ? 1 : ((a > b) ? -1 : 0)); } } );