Home Unanswered Active Tags New Question

parse DateTime error in DayPilotCalendar

I'm getting "Unable to parse DateTime: 'NaN=NaN-NaNtNaN:NaN:NaN' string was not recognized as a valid DateTime. I'm using TimeRangeSelectedHandling="CallBack" and the error occurs as soon as I click on an empty timeslot on the DayPilotCalendar. This occurs before the OnTimeRangeSelected event fires. Where is this invalid format coming from?

Asked by Anonymous 3 years ago.
Replies
Do you use ViewType="Resources"? What version of DayPilot do you use?

There used to be a bug that caused this NaN-NaN error. It happened when you defined your own columns but didn't specify Date property for them. But I thought it was already fixed....

Please let me know.
Comment posted by Dan Letecky 3 years ago.
I'm using viewtype=resources and I do define my own columns. The version of the DayPilot.dll I'm referencing is 4.6.1385.1. How do I define date propreties for my columns?
Comment posted by Anonymous 3 years ago.
You can either switch to 4.7 or later or specify the Date property (example from 4.6 SP1 release notes):

DayPilotCalendar1.Columns.Clear();
for (int i = 0; i < 3; i++)
{
DateTime day = DateTime.Today.AddDays(i);

Column c = new Column(day.ToShortDateString(), day.ToString("s"));
c.Date = day;
DayPilotCalendar1.Columns.Add(c);

}
Comment posted by Dan Letecky 3 years ago.
New Reply
This reply is
Your name (optional):

DayPilot for ASP.NET WebForms, DayPilot for ASP.NET MVC, DayPilot for Java