Coder Social home page Coder Social logo

Comments (7)

LionelMartin avatar LionelMartin commented on July 22, 2024

Failing test case here : https://github.com/LionelMartin/ical.js/commit/a32a747900dddba64d65f46e8591521de62bfbaf#test

from ical.js.

bastinat0r avatar bastinat0r commented on July 22, 2024

Same problem here.
(LionelMartin: thanks for the hack)

from ical.js.

peterbraden avatar peterbraden commented on July 22, 2024

I believe this was fixed by #48 - can you run your test and confirm?

I'd love to add the test to the suite if this solves it.

from ical.js.

Angus71 avatar Angus71 commented on July 22, 2024

I also stumbled across this one and made some changes, which work for me. From my point of view this is still a hack, as I don't like the changes I've made in ical.js/addTZ(..). Maybe somebody has a better idea, how to implement it.
The main problem I found, was that you can't depend on the position of the "DTSTART" if this comes before the "RRULE" then the #48 might work, but I had problems with it as the fix will not update the already created a "BYMOUNTH" and "BYDATE" in the rrule cache.
On the other hand if "DTSTART" follows RRULE #48 might never work, so the same fix done in "RRULE" handling needs also be done when DTSTART is parsed.
As said previously I consider this quite a hack, but as this problem is around nearly a year I though sharing might be helpful. If required/wanted I can created a pull request, but the code might need some additional testing.

from ical.js.

risacher avatar risacher commented on July 22, 2024

I ran across this problem also. The fix for #48 does not completely fix #21 - in that ev.rrule.between() does not seem to work properly... even though rrule.options.dtstart seems to be set, it's not being honored. (Perhaps ev.rrule.origOptions is being used instead?)

I independently developed my own fix, which is shown below. This code fixes the problems that I was experiencing, but potentially suffers the same deficiency that @Angus71 noted, namely that if "DTSTART" comes after the "RRULE", then it should not work. (and if RRULE includes a DTSTART field it will be overwritten, although this is easily fixed.)

ical.objectHandlers['RRULE'] = function(val, params, curr, stack, line){        
  var rule = line.replace("RRULE:", "");                                        
  rule += ";DTSTART="+curr.start.toISOString().replace(/[-:]/g,'');             
  rule = rule.replace(/\.[0-9]{3}/, "");                                        
  curr['rrule'] = rrule.fromString(rule);                                       
  return curr                                                                   
}             

from ical.js.

risacher avatar risacher commented on July 22, 2024

The DTSTART/RRULE sequencing issue noted by @Angus71 (and later me) should probably be fixed by moving the code that patches up the RRULE with a default start date into the objectHandler for 'END'. I'll try this tonight.

from ical.js.

ericlathrop avatar ericlathrop commented on July 22, 2024

@risacher Any luck fixing this?

from ical.js.

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.