Sorting: Update `dd.mm.YYYY HH:mm` plug-in to support seconds.

fix to sort with seconds
pull/292/head
Allan Jardine 8 years ago committed by GitHub
commit a7ba2feda5

@ -29,7 +29,11 @@
var deDatea = jQuery.trim(a).split(' '); var deDatea = jQuery.trim(a).split(' ');
var deTimea = deDatea[1].split(':'); var deTimea = deDatea[1].split(':');
var deDatea2 = deDatea[0].split('.'); var deDatea2 = deDatea[0].split('.');
x = (deDatea2[2] + deDatea2[1] + deDatea2[0] + deTimea[0] + deTimea[1]) * 1; if(typeof deTimea[2] != 'undefined') {
x = (deDatea2[2] + deDatea2[1] + deDatea2[0] + deTimea[0] + deTimea[1] + deTimea[2]) * 1;
} else {
x = (deDatea2[2] + deDatea2[1] + deDatea2[0] + deTimea[0] + deTimea[1]) * 1;
}
} else { } else {
x = Infinity; // = l'an 1000 ... x = Infinity; // = l'an 1000 ...
} }
@ -38,7 +42,11 @@
var deDateb = jQuery.trim(b).split(' '); var deDateb = jQuery.trim(b).split(' ');
var deTimeb = deDateb[1].split(':'); var deTimeb = deDateb[1].split(':');
deDateb = deDateb[0].split('.'); deDateb = deDateb[0].split('.');
y = (deDateb[2] + deDateb[1] + deDateb[0] + deTimeb[0] + deTimeb[1]) * 1; if(typeof deTimeb[2] != 'undefined') {
y = (deDateb[2] + deDateb[1] + deDateb[0] + deTimeb[0] + deTimeb[1] + deTimeb[2]) * 1;
} else {
y = (deDateb[2] + deDateb[1] + deDateb[0] + deTimeb[0] + deTimeb[1]) * 1;
}
} else { } else {
y = Infinity; y = Infinity;
} }
@ -52,7 +60,11 @@
var deDatea = jQuery.trim(a).split(' '); var deDatea = jQuery.trim(a).split(' ');
var deTimea = deDatea[1].split(':'); var deTimea = deDatea[1].split(':');
var deDatea2 = deDatea[0].split('.'); var deDatea2 = deDatea[0].split('.');
x = (deDatea2[2] + deDatea2[1] + deDatea2[0] + deTimea[0] + deTimea[1]) * 1; if(typeof deTimea[2] != 'undefined') {
x = (deDatea2[2] + deDatea2[1] + deDatea2[0] + deTimea[0] + deTimea[1] + deTimea[2]) * 1;
} else {
x = (deDatea2[2] + deDatea2[1] + deDatea2[0] + deTimea[0] + deTimea[1]) * 1;
}
} else { } else {
x = Infinity; x = Infinity;
} }
@ -61,7 +73,11 @@
var deDateb = jQuery.trim(b).split(' '); var deDateb = jQuery.trim(b).split(' ');
var deTimeb = deDateb[1].split(':'); var deTimeb = deDateb[1].split(':');
deDateb = deDateb[0].split('.'); deDateb = deDateb[0].split('.');
y = (deDateb[2] + deDateb[1] + deDateb[0] + deTimeb[0] + deTimeb[1]) * 1; if(typeof deTimeb[2] != 'undefined') {
y = (deDateb[2] + deDateb[1] + deDateb[0] + deTimeb[0] + deTimeb[1] + deTimeb[2]) * 1;
} else {
y = (deDateb[2] + deDateb[1] + deDateb[0] + deTimeb[0] + deTimeb[1]) * 1;
}
} else { } else {
y = Infinity; y = Infinity;
} }
@ -107,4 +123,3 @@
return z; return z;
} }
} ); } );

Loading…
Cancel
Save