I’m testing DHTMLX Scheduler .NET before buying it and I want te get all Recurring events on a specific Day.
Here is my code :
[code]
var from = new DateTime(2016, 3, 26);
var to = new DateTime(2016, 3, 28);
var testEvent = new CalendarEvent() {
start_date = new DateTime(2016, 3, 27,12,0,0),
end_date = new DateTime(2016,3, 27,20,0,0),
event_length = null,
event_pid = null,
id = 0,
rec_type = "",
text = "Test event"
};
var events = new List<CalendarEvent>() { testEvent };
var helper = new DHXEventsHelper();
var events2 = helper.GetOccurrences(events, from, to);[/code]
Here is the CalendarEvent :
public class CalendarEvent {
public int id { get; set; }
public string text { get; set; }
public DateTime? start_date { get; set; }
public DateTime? end_date { get; set; }
public long? event_length { get; set; }
public string rec_type { get; set; }
public int? event_pid { get; set; }
}
And the error :
[NullReferenceException: Object reference not set to an instance of an object.]
DHTMLX.Common.DHXEventsHelper.b__1(_ParsedEventData e) +35
System.Linq.WhereListIterator1.MoveNext() +73 System.Collections.Generic.List
1…ctor(IEnumerable1 collection) +381 System.Linq.Enumerable.ToList(IEnumerable
1 source) +58
DHTMLX.Common.DHXEventsHelper.GetOccurrences(IEnumerable items, DateTime from, DateTime to) +1003
thanks you