Hi im using the client side edit for the scheduler top redirect to another page. This gives me a url like:
activity.aspx?start=1175232600000&allday=false
Just wondering how I can interpret the start datetime? Do I need to new up a RadScheduler?
Thanks!
1 Answer, 1 is accepted
0
T. Tsonev
Telerik team
answered on 30 Oct 2007, 08:35 AM
Hi Sentia,
I guess that you are referring to the RadWindow integration example. The date here is represented as JavaScript ticks. You can use the following code to convert them to a date on the server:
DateTime time = new DateTime((jsMilliseconds * TimeSpan.TicksPerMillisecond) + tickDiff, DateTimeKind.Utc);
return time;
}
This is not the best solution and since the initial version, we have improved the example to use a more readable date format. The new version is not uploaded yet, but you can use the following JavaScript code to format the date for use in the query string:
function formatDate(date)
{
var year = padNumber(date.getUTCFullYear(), 4);
var month = padNumber(date.getUTCMonth() + 1, 2);
var day = padNumber(date.getUTCDate(), 2);
var hour = padNumber(date.getUTCHours(), 2);
var minute = padNumber(date.getUTCMinutes(), 2);
return year + month + day + hour + minute;
}
function padNumber(number, totalDigits)
{
number = number.toString();
var padding = '';
if (totalDigits > number.length)
{
for (i = 0; i < (totalDigits - number.length); i++)
{
padding += '0';
}
}
return padding + number.toString();
}
Then on the server-side you can parse it like this