Board Logo

Sort columne by date (EURO)
Marko Polak - 3/15/2003 at 09:12 AM

Have you got any example for using table PRO within this combination ?
Thanks


nik - 3/17/2003 at 08:34 AM

Simple sorting routine for dates is:

return Date.parse(a) < Date.parse(b)


apawiper - 10/16/2003 at 10:00 AM

Try this function for sorting data with the format: DD-MM-YY (example: 04-02-2005)

function sortdate(a,b){

var dd, d, m, y;
var diau1, mesu1, anyu1, diau2, mesu2, anyu2;
var dat1, dat2;
diau1 = a.substring(0,2);
mesu1 = a.substring(3,5);
anyu1 = a.substring(6,10);
diau1 = diau1 / 10000;
mesu1 = mesu1 / 100;
dat1 = anyu1 - - mesu1 - - diau1;
diau2 = b.substring(0,2);
mesu2 = b.substring(3,5);
anyu2 = b.substring(6,10);
diau2 = diau2 / 10000;
mesu2 = mesu2 / 100;
dat2 = anyu2 - - mesu2 - - diau2;
if (dat1 < dat2)
{
return 1;
}
else
{
if (dat1 > dat2)
{
return 0;
}
else
{
return 0;
}
}
}


Softcomplex: http://www.softcomplex.com/
Back to forum: http://www.softcomplex.com/forum/