What wacko date is this - DayPilot Forums http://forums.daypilot.org/Topic.aspx/38/what_wacko_date_is_this_ Replies to question '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..

]]>
http://forums.daypilot.org/Topic.aspx/38/what_wacko_date_is_this_ Anonymous http://forums.daypilot.org/Topic.aspx/38/what_wacko_date_is_this_ Thu, 26 Apr 2007 04:15:19 +0200
New reply to 'What wacko date is this'
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.]]>
http://forums.daypilot.org/Topic.aspx/38/what_wacko_date_is_this_#q3fl5ca6ojg5vddy3fiqux65uy Dan Letecky http://forums.daypilot.org/Topic.aspx/38/what_wacko_date_is_this_#q3fl5ca6ojg5vddy3fiqux65uy Thu, 26 Apr 2007 09:29:18 +0200