Update date-de sorting from #296 with -Infinity

pull/285/merge
Allan Jardine 8 years ago
parent 5e45ca16eb
commit 9618bbfa9f

@ -35,7 +35,7 @@
x = (deDatea2[2] + deDatea2[1] + deDatea2[0] + deTimea[0] + deTimea[1]) * 1; x = (deDatea2[2] + deDatea2[1] + deDatea2[0] + deTimea[0] + deTimea[1]) * 1;
} }
} else { } else {
x = 0; // = l'an 1000 ... x = -Infinity; // = l'an 1000 ...
} }
if (jQuery.trim(b) !== '') { if (jQuery.trim(b) !== '') {
@ -48,7 +48,7 @@
y = (deDateb[2] + deDateb[1] + deDateb[0] + deTimeb[0] + deTimeb[1]) * 1; y = (deDateb[2] + deDateb[1] + deDateb[0] + deTimeb[0] + deTimeb[1]) * 1;
} }
} else { } else {
y = 0; y = -Infinity;
} }
var z = ((x < y) ? -1 : ((x > y) ? 1 : 0)); var z = ((x < y) ? -1 : ((x > y) ? 1 : 0));
return z; return z;
@ -79,7 +79,7 @@
y = (deDateb[2] + deDateb[1] + deDateb[0] + deTimeb[0] + deTimeb[1]) * 1; y = (deDateb[2] + deDateb[1] + deDateb[0] + deTimeb[0] + deTimeb[1]) * 1;
} }
} else { } else {
y = 0; y = -Infinity;
} }
var z = ((x < y) ? 1 : ((x > y) ? -1 : 0)); var z = ((x < y) ? 1 : ((x > y) ? -1 : 0));
return z; return z;
@ -98,7 +98,7 @@
var deDateb = jQuery.trim(b).split('.'); var deDateb = jQuery.trim(b).split('.');
y = (deDateb[2] + deDateb[1] + deDateb[0]) * 1; y = (deDateb[2] + deDateb[1] + deDateb[0]) * 1;
} else { } else {
y = 0; y = -Infinity;
} }
var z = ((x < y) ? -1 : ((x > y) ? 1 : 0)); var z = ((x < y) ? -1 : ((x > y) ? 1 : 0));
return z; return z;
@ -110,7 +110,7 @@
var deDatea = jQuery.trim(a).split('.'); var deDatea = jQuery.trim(a).split('.');
x = (deDatea[2] + deDatea[1] + deDatea[0]) * 1; x = (deDatea[2] + deDatea[1] + deDatea[0]) * 1;
} else { } else {
x = 0; x = -Infinity;
} }
if (jQuery.trim(b) !== '') { if (jQuery.trim(b) !== '') {

Loading…
Cancel
Save