Comments (11)
The simplified versions for Outlook, e.g. http://tzurl.org/zoneinfo-outlook/Europe/Berlin.ics are working.
from ical.net.
In the future, please post a code snippet that shows how the error occurred instead of just a stack trace.
I assume you're doing something like:
const string berlin = "http://tzurl.org/zoneinfo/Europe/Berlin.ics";
var calendar = Calendar.LoadFromStream(new StringReader(berlin));
This isn't valid. You will have to download the contents of that URL, and then pass the ics contents as a string. The wiki has some examples of how to download a calendar, and then parsing the ics string.
ical.net will never support downloading resources from URLs. You will have to do that from within your application. The reasons for that are at the wiki section I linked above.
from ical.net.
nope downloaded via httpclient or webclient and passed the string. problem is the utc offset with seconds I believe. Can post the code when I have access to the pc later.
from ical.net.
Yeah, behind the scenes, it's using the Parse()
method from either DateTime
or DateTimeOffset
, which doesn't support seconds.
Historically, dday.ical's original implementation used regex's to parse the offset, but it didn't work in some normal use cases (like if you prefixed a positive offset with a +
which is Microsoft's way of displaying offsets!), so I threw away that part of the code, and replaced it with the built-in parser. There was no need for dday to re-invent the wheel.
from ical.net.
true a lot of redundant code in dday.ical :) still need me to find the code snippet or can you reproduce it?
from ical.net.
I can reproduce it, but I'm not going to fix it. It's a .NET library. It seems reasonable to use .NET conventions when they match the behavior of the BCL.
from ical.net.
But since a lot of clients use that timezone definitions (Davdroid for example) the library shouldn't crash when loading a valid ics file or?
from ical.net.
My time isn't unlimited. :) I'm not going to re-implement offset parsing to catch some corner case that could reasonably be caught by the client. There are no time zones that have resolutions smaller than 15 minute intervals.
The quick and dirty alternative it to see if there is more than one :
at the end of the string, and truncate everything from the second :
on if there is. You can do that if you'd like, if you like. I merge other people's PRs all the time.
from ical.net.
Ok will look into it in more detail, relevant code is in UTCOffsetSerializer.cs, right?
from ical.net.
actually according to the rfc 5545
3.3.14. UTC Offset
Value Name: UTC-OFFSET
Purpose: This value type is used to identify properties that contain
an offset from UTC to local time.Format Definition: This value type is defined by the following
notation:utc-offset = time-numzone time-numzone = ("+" / "-") time-hour time-minute [time-second]
there are no :
in it and therefore nothing to truncate
from ical.net.
Fix published in nuget version 2.2.32:
https://www.nuget.org/packages/Ical.Net
from ical.net.
Related Issues (20)
- Modify a Recurring/occurrence Instance
- PeriodSerializer not working with midnight DATE-TIME.
- How do we update/remove attachments? HOT 1
- ios 16 calendar issue
- GetOccurrences Creates event with invalid time due to Daylight Savings changes
- GetOccurences not respecting different timezones in ICS file HOT 1
- RDATE deserialization: Can't keep apart Periods and Dates/Times
- How can I find the rest of the instances of a recurring event? HOT 1
- AsDateTimeOffset return wrong offset for America/mexico_city time zone HOT 1
- CalendarEvent mixes up `DURATION` and `DTEND` on deserialization
- Report PRODID and line number when parse exception occurs
- Natural Language de/serialization HOT 1
- Serialize and then Load calendar breaks GetOccurrences HOT 1
- Regex failure
- AddTimeZone(string, DateTime, bool) fails if the DateTime parameter is a leap day (February 29) HOT 1
- [Question] How to load calendar data from generic (Synology) CalDav server with username / password authentication? HOT 1
- Sync issue with Outlook 365 Calendar
- Read Organizer.SentBy throw exception
- RecurrencePattern.Until DateTime property should be a CalDateTime
- TimeZones Daylight saving Info not up-to-date
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ical.net.