Project

General

Profile

patch-src_mod_dirlisting.c.patch

fjo, 2017-10-01 13:50

View differences:

src/mod_dirlisting.c
586 586
"      : (unit=='E') ? 1000000000000000000 : 1;\n" \
587 587
"}\n" \
588 588
"\n" \
589
"function parse_date(d) {\n" \
590
"  var match = /(\\d{4})-(\\w{3})-(\\d{2})\\s+(\\d{2}:\\d{2}:\\d{2})/.exec(d);\n" \
591
"  return Date.parse((match) ? match[2] + ' ' + match[3] + ', ' + match[1] + ' ' + match[4]\n" \
592
"                            : d.replace(/-/g, '/'));\n" \
593
"}\n" \
594
"\n" \
589 595
"function sortfn_then_by_name(a,b,sort_column) {\n" \
590 596
" if (sort_column == name_column || sort_column == type_column) {\n" \
591 597
"  var ad = (a.cells[type_column].innerHTML === 'Directory');\n" \
......
602 608
" if (a.cells[sort_column].className == 'int') {\n" \
603 609
"  cmp = parseInt(at)-parseInt(bt);\n" \
604 610
" } else if (sort_column == date_column) {\n" \
605
"  cmp = Date.parse(at.replace(/-/g, '/'))\n" \
606
"      - Date.parse(bt.replace(/-/g, '/'));\n" \
611
"  cmp = parse_date(at) - parse_date(bt);\n" \
607 612
"  var ad = isdigit(at.substr(0,1));\n" \
608 613
"  var bd = isdigit(bt.substr(0,1));\n" \
609 614
"  if (ad != bd) return (!ad ? -1 : 1);\n" \