You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi,
For my project, I'm using Ical.net but I can't add the DayLight or Standard to my ical. This means my time jumps an hour when adding it to my agenda (Gmail, outlook, ...). I have read all the questions about this topic but still don't understand how to solve this problem. Could someone please advise what I'm missing in my code. I tried all kinds of things, nodatime, ... but I suppose my knowledge is not enough to solve this problem alone. This project must be delivered before end of the week so that's why I request your help...
var calendar = new Ical.Net.Calendar();
calendar.AddTimeZone(new VTimeZone("Europe/Brussels"));
calendar.Events.Add(new Event
{
Class = "PUBLIC",
Summary = inscription.Session.Training.Name,
Created = new CalDateTime(DateTime.Now),
Description = inscription.Session.Training.Description,
Start = new CalDateTime(Convert.ToDateTime(inscription.Session.Date + inscription.Session.StartTime), "Europe/Brussels"),
End = new CalDateTime(Convert.ToDateTime(inscription.Session.Date + inscription.Session.EndTime), "Europe/Brussels"),
Sequence = 0,
Uid = Guid.NewGuid().ToString(),
Location = inscription.Session.Location.FullAdres,
});
var serializer = new CalendarSerializer(new SerializationContext());
var serializedCalendar = serializer.SerializeToString(calendar);
var bytesCalendar = Encoding.UTF8.GetBytes(serializedCalendar);
MemoryStream ms = new MemoryStream(bytesCalendar);
System.Net.Mail.Attachment attachment = new System.Net.Mail.Attachment(ms, "event.ics", "text/calendar");
The text was updated successfully, but these errors were encountered:
Hi,
For my project, I'm using Ical.net but I can't add the DayLight or Standard to my ical. This means my time jumps an hour when adding it to my agenda (Gmail, outlook, ...). I have read all the questions about this topic but still don't understand how to solve this problem. Could someone please advise what I'm missing in my code. I tried all kinds of things, nodatime, ... but I suppose my knowledge is not enough to solve this problem alone. This project must be delivered before end of the week so that's why I request your help...
var calendar = new Ical.Net.Calendar();
calendar.AddTimeZone(new VTimeZone("Europe/Brussels"));
calendar.Events.Add(new Event
{
Class = "PUBLIC",
Summary = inscription.Session.Training.Name,
Created = new CalDateTime(DateTime.Now),
Description = inscription.Session.Training.Description,
Start = new CalDateTime(Convert.ToDateTime(inscription.Session.Date + inscription.Session.StartTime), "Europe/Brussels"),
End = new CalDateTime(Convert.ToDateTime(inscription.Session.Date + inscription.Session.EndTime), "Europe/Brussels"),
Sequence = 0,
Uid = Guid.NewGuid().ToString(),
Location = inscription.Session.Location.FullAdres,
});
var serializer = new CalendarSerializer(new SerializationContext());
var serializedCalendar = serializer.SerializeToString(calendar);
var bytesCalendar = Encoding.UTF8.GetBytes(serializedCalendar);
MemoryStream ms = new MemoryStream(bytesCalendar);
System.Net.Mail.Attachment attachment = new System.Net.Mail.Attachment(ms, "event.ics", "text/calendar");
The text was updated successfully, but these errors were encountered: