Improve sorting for dates without hours

This modification allow to sort dates in formet DD/MM/YYYY as well as
dates in format DD/MM/YYYY HH:II:SS without error « frDatea[1] undefined
» on line 30
pull/236/head
Cyrano 9 years ago
parent 1692a8e63c
commit 2c70170812

@ -27,7 +27,7 @@
if ( $.trim(a) !== '' ) { if ( $.trim(a) !== '' ) {
var frDatea = $.trim(a).split(' '); var frDatea = $.trim(a).split(' ');
var frTimea = frDatea[1].split(':'); var frTimea = (undefined != frDatea[1]) ? frDatea[1].split(':') : [00,00,00];
var frDatea2 = frDatea[0].split('/'); var frDatea2 = frDatea[0].split('/');
x = (frDatea2[2] + frDatea2[1] + frDatea2[0] + frTimea[0] + frTimea[1] + frTimea[2]) * 1; x = (frDatea2[2] + frDatea2[1] + frDatea2[0] + frTimea[0] + frTimea[1] + frTimea[2]) * 1;
} }

Loading…
Cancel
Save