WebFX WebBoard
Message Thread:
View All Messages
Back to WebFX
 sortabletable date fix, dack, October 14, 2003
     Re:sortabletable date fix, Ade, November 17, 2003

Subject: Re:sortabletable date fix From: Ade Date: November 17, 2003
before seeing this, i came up with the following...


var parts = sText.split(DATE_TIME_SPLITTER);
if (parts.length > 0)
{
var dateParts = parts[0].split(DATE_SPLITTER);
}
if (parts.length > 1)
{
var timeParts = parts[1].split(TIME_SPLITTER);
}

var d = dateParts[DATE_YEAR_PART] +
dateParts[DATE_MONTH_PART] +
dateParts[DATE_DAY_PART];

if (timeParts)
{
d += timeParts[TIME_HOUR_PART] +
timeParts[TIME_MIN_PART] +
timeParts[TIME_SEC_PART];
}

return d;


with the following config settings defined...

var DATE_SPLITTER = '/';
var DATE_YEAR_PART = 2;
var DATE_MONTH_PART = 1;
var DATE_DAY_PART = 0;

var DATE_TIME_SPLITTER = ' ';
var TIME_SPLITTER = ':';

var TIME_HOUR_PART = 0;
var TIME_MIN_PART = 1;
var TIME_SEC_PART = 2;



Reply
Name: 
Email: 
Subject: 

Enter your reply to this message below. HTML tags are not supported but words that start with http://, ftp:// or mailto: are converted to links.


View All Messages
Back to WebFX