Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add VTimeZone but doesn't show DayLight or Standard #241

Closed
Johna76 opened this issue Mar 7, 2017 · 2 comments
Closed

Add VTimeZone but doesn't show DayLight or Standard #241

Johna76 opened this issue Mar 7, 2017 · 2 comments

Comments

@Johna76
Copy link

Johna76 commented Mar 7, 2017

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");

@beriniwlew
Copy link
Collaborator

This is related to #58

@rianjs
Copy link
Collaborator

rianjs commented Nov 13, 2017

Fixed in nuget version 4.0.0: https://www.nuget.org/packages/Ical.Net/4.0.0

@rianjs rianjs closed this as completed Nov 13, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants