Giter Club home page Giter Club logo

Comments (11)

aluxnimm avatar aluxnimm commented on August 11, 2024

The simplified versions for Outlook, e.g. http://tzurl.org/zoneinfo-outlook/Europe/Berlin.ics are working.

from ical.net.

rianjs avatar rianjs commented on August 11, 2024

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.

aluxnimm avatar aluxnimm commented on August 11, 2024

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.

rianjs avatar rianjs commented on August 11, 2024

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.

aluxnimm avatar aluxnimm commented on August 11, 2024

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.

rianjs avatar rianjs commented on August 11, 2024

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.

aluxnimm avatar aluxnimm commented on August 11, 2024

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.

rianjs avatar rianjs commented on August 11, 2024

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.

aluxnimm avatar aluxnimm commented on August 11, 2024

Ok will look into it in more detail, relevant code is in UTCOffsetSerializer.cs, right?

from ical.net.

aluxnimm avatar aluxnimm commented on August 11, 2024

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.

rianjs avatar rianjs commented on August 11, 2024

Fix published in nuget version 2.2.32:
https://www.nuget.org/packages/Ical.Net

from ical.net.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.