From 2c70170812b9f7d696c8282406d9752741eebe54 Mon Sep 17 00:00:00 2001 From: Cyrano Date: Tue, 22 Dec 2015 10:43:52 +0100 Subject: [PATCH] Improve sorting for dates without hours MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 --- sorting/date-euro.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sorting/date-euro.js b/sorting/date-euro.js index a2e0758..758fd5c 100644 --- a/sorting/date-euro.js +++ b/sorting/date-euro.js @@ -27,7 +27,7 @@ if ( $.trim(a) !== '' ) { 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('/'); x = (frDatea2[2] + frDatea2[1] + frDatea2[0] + frTimea[0] + frTimea[1] + frTimea[2]) * 1; }