RecurrenceExpander.Expand Issue
10 years ago.
How does this work? I have used this in many locations without any issues, but I am having trouble now. I am getting events from a database and trying to 'block; other openings on the calendar. Things are working fine until I edit a single occurrence of an event.
For example I have a recurring event that is scheduled to start on 3/8 @ 9:15am to repeat weekly 3 times. I then edited the occurrence on 3/8 and moved it to 3/1 @ 9:15am. When I select the events from the database I get the following:
dtEvents.Rows[0].ItemArray
{object[7]}
[0]: 671
[1]: {3/1/2016 9:15:00 AM}
[2]: {3/1/2016 10:15:00 AM}
[3]: "01:00:00"
[4]: "Njcw#1#M#2016-03-08T09:15:00"
[5]: 1
[6]: {3/1/2016 10:15:00 AM}
I use the following to get expand the events.
DataTable dtEventsExpanded = RecurrenceExpander.Expand(dtEvents, "Recurrence", "StartDate", "CurrentEndDate", "CalendarEventID", "Master2", e.Start, e.End);
but in the expanded event table there is nothing.
e.Start
{3/1/2016 9:15:00 AM}
Date: {3/1/2016 12:00:00 AM}
Day: 1
DayOfWeek: Tuesday
DayOfYear: 61
Hour: 9
Kind: Unspecified
Millisecond: 0
Minute: 15
Month: 3
Second: 0
Ticks: 635924205000000000
TimeOfDay: {09:15:00}
Year: 2016
e.End
{3/1/2016 10:15:00 AM}
Date: {3/1/2016 12:00:00 AM}
Day: 1
DayOfWeek: Tuesday
DayOfYear: 61
Hour: 10
Kind: Unspecified
Millisecond: 0
Minute: 15
Month: 3
Second: 0
Ticks: 635924241000000000
TimeOfDay: {10:15:00}
Year: 2016
I event tried subtracting a year from the start and adding a year to the end:
e.Start.AddYears(-1)
{3/1/2015 9:15:00 AM}
Date: {3/1/2015 12:00:00 AM}
Day: 1
DayOfWeek: Sunday
DayOfYear: 60
Hour: 9
Kind: Unspecified
Millisecond: 0
Minute: 15
Month: 3
Second: 0
Ticks: 635607981000000000
TimeOfDay: {09:15:00}
Year: 2015
e.End.AddYears(1)
{3/1/2017 10:15:00 AM}
Date: {3/1/2017 12:00:00 AM}
Day: 1
DayOfWeek: Wednesday
DayOfYear: 60
Hour: 10
Kind: Unspecified
Millisecond: 0
Minute: 15
Month: 3
Second: 0
Ticks: 636239601000000000
TimeOfDay: {10:15:00}
Year: 2017
but still get nothing when expanded.
What am I missing?
DayPilot