Home My Page Projects FusionForge
Summary Activity Forums Tracker Lists News SCM Files Mediawiki Hudson/Jenkins

[#649] Docman : sorting documents by dates doesn't work

Date:
2014-03-25 14:08
Priority:
3
State:
Closed
Submitted by:
Matthieu DURAND (mdurand)
Assigned to:
Franck Villaume (nerville)
Target Release:
5.3
Found in Version:
5.2.3
Severity:
minor
Resolution:
Fixed
Summary:
Docman : sorting documents by dates doesn't work

Detailed description
In docman, the sorting by dates doesn't work. The sorting is alphabetical, so it's not OK with french date format.

It's not expected that dates are on JJ/MM/AAAA HH:MM format in "sortable.js" file. (but only JJ/MM/AAAA, without hours and minutes)

----------------------------------------------------------------------------------------------------
A possible correction in "src/www/js/sortable.js" file:

Add in "ts_resortTable" function this test :

if (itm.match("^(0[1-9]|[12][0-9]|3[01])/(0[1-9]|1[012])/[0-9]{4} ([01][0-9]|2[0-3]):([0-5][0-9])$")) sortfn = ts_sort_date;


Add in "sort_date" function this code :
else if (date.length == 16) {
if (europeandate == false) {
dt = date.substr(6,4)+date.substr(0,2)+date.substr(3,2)+date.substr(11,5);
return dt;
} else {
dt = date.substr(6,4)+date.substr(3,2)+date.substr(0,2)+date.substr(11,5);
return dt;
}
}

Message  ↓
Date: 2014-03-26 09:16
Sender: Franck Villaume

branch_5_3 : fix in commit 7d020680c7cbfa0e6a0a3a2e86ecb6000b6a3992

Date: 2014-03-26 09:01
Sender: Franck Villaume

solution : use sorttable_customkey

Field Old Value Date By
status_idOpen2014-03-26 09:16nerville
close_dateNone2014-03-26 09:16nerville
assigned_tonone2014-03-26 09:16nerville
Target ReleaseNone2014-03-26 09:16nerville
ResolutionNone2014-03-26 09:16nerville
Target Release5.32014-03-26 08:42nerville