WebFX WebBoard
Message Thread:
View All Messages
Back to WebFX
 Sort. Tables - Sort by date & time, Andi, June 9, 2005

Subject: Sort. Tables - Sort by date & time From: Andi Date: June 9, 2005

sorting for date work fine with the given funtion in sortabletable.js.

However, I have a time (email arrival date/time) in my application in the same column and I can not get it to work properly.

Here is what I get from php: dd.mm.yyyy hh:mm  (while hh is a 24 hour time), example: 01.12.2005 17:25

Here is what I am trying to change the normal date funtion to (and you will now recognize that I dont have such a good idea about js):

SortableTable.toDate = function (s) {
 var parts = s.split(".", "", ":");  // the ":" and the " " to the splitters
 var d = new Date(0);
 d.setMonth(parts[1] - 1);
 d.setHours(parts[0]); //added hours, but what is that "parts" thingi for ?
 d.setMinutes(parts[0]); //added minutes
 return d.valueOf();


Can somone please have a look, as soon as I fix this I can release the stuff.
Thanks, Andi





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