search envelope-o feed check
Home Unanswered Active Tags New Question
user comment-o

parse DateTime error in DayPilotCalendar

Asked by Anonymous
13 years ago.

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?

Comment posted by Dan Letecky
13 years ago.
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 Anonymous
13 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 Dan Letecky
13 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);

}
This question is more than 3 months old and has been closed. Please create a new question if you have anything to add.