rem: if (a.grp != b.grp) return a.grp-b.grp;  aa = a.txt; bb = b.txt; if (aa.length == 10) { dt1 = aa.substr(6,4)+aa.substr(3,2)+aa.substr(0,2); } else { yr = aa.substr(6,2); if (parseInt(yr) < 50) { yr = '20'+yr; } else { yr = '19'+yr; } dt1 = yr+aa.substr(3,2)+aa.substr(0,2); } if (bb.length == 10) { dt2 = bb.substr(6,4)+bb.substr(3,2)+bb.substr(0,2); } else { yr = bb.substr(6,2); if (parseInt(yr) < 50) { yr = '20'+yr; } else { yr = '19'+yr; } dt2 = yr+bb.substr(3,2)+bb.substr(0,2); } if (dt1==dt2) return a.idx-b.idx; if (dt1<dt2) return -1; return 1; 
add: dt1 = sort_date(ts_getInnerText(a.cells[SORT_COLUMN_INDEX])); dt2 = sort_date(ts_getInnerText(b.cells[SORT_COLUMN_INDEX]));  if (dt1==dt2) { return 0; } if (dt1<dt2) { return -1; } return 1; 
context: function ts_sort_date(a,b) {    if (a.grp != b.grp) return a.grp-b.grp;    // y2k notes: two digit years less than 50 are treated as 20XX, greater than 50 are treated as 19XX    aa = a.txt;    bb = b.txt;    if (aa.length == 10) {        dt1 = aa.substr(6,4)+aa.substr(3,2)+aa.substr(0,2);    } else {        yr = aa.substr(6,2);        if (parseInt(yr) < 50) { yr = '20'+yr; } else { yr = '19'+yr; }        dt1 = yr+aa.substr(3,2)+aa.substr(0,2);    }    if (bb.length == 10) {        dt2 = bb.substr(6,4)+bb.substr(3,2)+bb.substr(0,2);    } else {        yr = bb.substr(6,2);        if (parseInt(yr) < 50) { yr = '20'+yr; } else { yr = '19'+yr; }        dt2 = yr+bb.substr(3,2)+bb.substr(0,2);    }    if (dt1==dt2) return a.idx-b.idx;    if (dt1<dt2) return -1;    return 1;}
meta: 7642	/local1/tlutelli/issta_data/temp/all_js/javascript/2007_temp/2007/7642/aecab3c29373db6e82c71b74856d5e1e7473ce96/sorttable.js/clean/skins/common/sorttable.js