jkbrzt / rrule

JavaScript library for working with recurrence rules for calendar dates as defined in the iCalendar RFC and more.
https://jkbrzt.github.io/rrule
Other
3.3k stars 513 forks source link

Need Help: How to set an event weekly to the past and to the future? #414

Open meness opened 4 years ago

meness commented 4 years ago

At the moment, the minimum date is now, but I want to add an event to the past and to the future without any limit. How can I do this?

new RRule({
            freq: RRule.WEEKLY,
            byweekday: RRule[weekDayName.substr(0, 2).toUpperCase()],
          })

Using dtstart with a date at 1970-01-01 has a problem with timezones with daylight time.

jamesfulford commented 5 months ago

I've found that doing rrule.options.dtstart = new Date("1970-01-01"); should get you somewhat closer; it seems to default the dtstart to today.