diff --git a/sorting/date-de.js b/sorting/date-de.js index 0a5a096..c3bffb7 100644 --- a/sorting/date-de.js +++ b/sorting/date-de.js @@ -29,7 +29,11 @@ var deDatea = jQuery.trim(a).split(' '); var deTimea = deDatea[1].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 { x = Infinity; // = l'an 1000 ... } @@ -38,7 +42,11 @@ var deDateb = jQuery.trim(b).split(' '); var deTimeb = deDateb[1].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 { y = Infinity; } @@ -52,7 +60,11 @@ var deDatea = jQuery.trim(a).split(' '); var deTimea = deDatea[1].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 { x = Infinity; } @@ -61,7 +73,11 @@ var deDateb = jQuery.trim(b).split(' '); var deTimeb = deDateb[1].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 { y = Infinity; } @@ -107,4 +123,3 @@ return z; } } ); -