4 Answers, 1 is accepted
Hello Анатолій,
This behavior seems to be observed only when using the XmlSchedulerProvider, due to the date format used to keep the dates in Xml file:
/// <summary>
/// Format string for the dates. The "Z" appendix signifies UTC time.
/// </summary>
private const string DateFormatString = "yyyy-MM-ddTHH:mmZ";
If the seconds are crucial in your application, you can create your custom XmlProvider using the built-in one as a reference point. The source code can be downloaded from Your Account:
Regards,
Peter Milchev
Progress Telerik
Our thoughts here at Progress are with those affected by the outbreak.
We are using in production version 2015.2.623.45. So it's critical for our customers.
There no problems with time format as I mentioned that on 'Edit' we have right seconds in the editing field. Problem have place only at scheduling tool-tips.
Are there any easy solutions to complete this case?
Hello Anatoliy,
You are correct, the client-side objects of the appointments have the dates in the following format: "yyyy/MM/dd HH:ss".
To workaround that, you can save the seconds in OnAppointmentDataBound event to the appointment's attributes.
protected void RadScheduler1_AppointmentDataBound(object sender, SchedulerEventArgs e)
{
e.Appointment.Attributes.Add("startSeconds", e.Appointment.Start.Second.ToString());
e.Appointment.Attributes.Add("endSeconds", e.Appointment.End.Second.ToString());
}
Then you can fix the start time as below:
<script>
function fixSeconds() {
scheduler = $find("<%= RadScheduler1.ClientID %>");
scheduler.get_appointments().forEach(function (apt) {
if (apt.get_attributes().getAttribute("startSeconds")) {
apt.get_start().setSeconds(apt.get_attributes().getAttribute("startSeconds"));
}
if (apt.get_attributes().getAttribute("endSeconds")) {
apt.get_end().setSeconds(apt.get_attributes().getAttribute("endSeconds"));
}
})
// Sys.Application.remove_load(fixSeconds);
}
Sys.Application.add_load(fixSeconds);
</script>
After applying this fix, the apt.get_start() will return the fixed time, with the correct seconds applied.
Regards,
Peter Milchev
Progress Telerik
Our thoughts here at Progress are with those affected by the outbreak.