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.