I'm trying to creat a calender event that will be an all day event and will repeat every year from a list that has everyone's birthday. The recurrence works great and so does the All day event.
The problem is when I set newBirthDay["All Day Event"] = 1; the recurrence all of a sudden doesn't put the event in the correct day, but in the next day.
So say your birthday is on the 8th month and 3rd day, it will actually show up on the calender on August 4th and this only happens when I try to make it an All Day Event. If I leave it as normal it will show up on the correct day August 3rd. Anyone have any idea what could cause this? the C# code is included that handles it.
Thanks for looking
newBirthDay = calList.Add();
newBirthDay["Title"] = "Happy Birthday, " + addBirthday["Title"].ToString();
newBirthDay["Entry Type"] = "Birthday";
string recurrence = "<recurrence><rule>" +
"<firstDayOfWeek>su</firstDayOfWeek>" +
"<repeat><yearly yearFrequency='1' month='" + addBirthday["Month"].ToString() +
"' day='" + addBirthday["Day"].ToString() + "'/></repeat>" +
"<repeatForever>FALSE</repeatForever>" +
"</rule></recurrence>";
newBirthDay["RecurrenceData"] = recurrence;
newBirthDay["EventType"] = 1;
newBirthDay["All Day Event"] = 1;
newBirthDay["Recurrence"] = 1;
newBirthDay["EventDate"] = new DateTime(DateTime.Now.Year, int.Parse(addBirthday["Month"].ToString()), int.Parse(addBirthday["Day"].ToString()));
newBirthDay["EndDate"] = new DateTime(DateTime.Now.AddYears(100).Year, int.Parse(addBirthday["Month"].ToString()), int.Parse(addBirthday["Day"].ToString()));
newBirthDay["UID"] = System.Guid.NewGuid();
newBirthDay["Description"] = "Happy Birthday, " + addBirthday["Name1"].ToString() + "\nbrithday = " + int.Parse(addBirthday["Day"].ToString()) + "|" + addBirthday["Day"].ToString();
newBirthDay.Update();