DayPilot Forums

DayPilot is the best open-source Outlook-like calendar control for ASP.NET.
DayPilot Pro Demo (Calendar control)
» DayPilot Pro live demo (Calendar control)
DayPilot Pro Demo (Scheduler control)
» DayPilot Pro live demo (Scheduler control)
Home » General » What wacko date is this

What wacko date is this

Ok, I give up what wacko date format is this "Thu Apr 26 09:30:00 UTC 1000 2007"

This is what fiddler shows is being sent to in the start parm of the javascript call..

This MUST be in ISO8601 at the very least..

Anonymous - 4/26/2007 4:15:19 AM
My fault. I'm behind the schedule with the documentation.

This has changed in DayPilot Pro and now the parameters are being passed as arguments to the javascript handler instead of the string placeholders ({0}).

The arguments passed to the TimeRangeSelectedJavaScript are:
  • start (Date object)
  • end (Date object)
  • column (string)
So you can convert it to UTC format using this code:

start.toUTCString();

The output is parsable by .NET's Convert.ToDateTime(). If you need the old format you need to convert it using a function like this:

function dateSortable(d) {
var second = d.getSeconds();
if (second < 10) second = "0" + second;
var minute = d.getMinutes();
if (minute < 10) minute = "0" + minute;
var hour = d.getHours();
if (hour < 10) hour = "0" + hour;
var day = d.getDate();
if (day < 10) day = "0" + day;
var month = d.getMonth() + 1;
if (month < 10) month = "0" + month;
var year = d.getFullYear();
return year + "-" + month + "-" + day + 'T' + hour + ":" + minute + ":" + second;
}

E.g.

dateSortable(start);

I've decided to switch to parameters instead of {0} placeholders because there is not just a single parameter in most javascript handlers and it would be messy with {0}, {1}, {2}, {3}, {4}, and {5}.

The basic documentation for time range selecting is now here: http://www.daypilot.org/time-range-selecting.html

If there is another way that would be more convenient for you just let me know.
Dan Letecky - 4/26/2007 9:29:18 AM
Post reply