Advertisement
turist_ua

date-euro-sorting

Dec 28th, 2012
151
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. jQuery.extend( jQuery.fn.dataTableExt.oSort, {
  2.     "date-euro-pre": function ( a ) {
  3.         if ($.trim(a) != '') {
  4.             var frDatea = $.trim(a).split(' ');
  5.             var frTimea = frDatea[1].split(':');
  6.             var frDatea2 = frDatea[0].split('.');
  7.             var x = (frDatea2[2] + frDatea2[1] + frDatea2[0] + frTimea[0] + frTimea[1] + frTimea[2]) * 1;
  8.         } else {
  9.             var x = 10000000000000; // = l'an 1000 ...
  10.         }
  11.  
  12.         return x;
  13.     },
  14.  
  15.     "date-euro-asc": function ( a, b ) {
  16.         return a - b;
  17.     },
  18.  
  19.     "date-euro-desc": function ( a, b ) {
  20.         return b - a;
  21.     }
  22. } );
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement