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

RRule is not defined #412

Closed chriscollins405 closed 4 years ago

chriscollins405 commented 4 years ago

So im stuck, and have used this fiddle to test....

https://jsfiddle.net/26qou094/1/

I'm including the script tag at the top

Then I have this....

import { RRule, RRuleSet, rrulestr } from 'rrule' const rule = new rrule.RRule({ freq: RRule.WEEKLY, interval: 5, byweekday: [RRule.MO, RRule.FR], dtstart: new Date(Date.UTC(2012, 1, 1, 10, 30)), until: new Date(Date.UTC(2012, 12, 31)) }); Which returns....

Uncaught TypeError: Failed to resolve module specifier "rrule". Relative references must start with either "/", "./", or "../"

Or i try this....

const rule = new rrule.RRule({ freq: RRule.WEEKLY, interval: 5, byweekday: [RRule.MO, RRule.FR], dtstart: new Date(Date.UTC(2012, 1, 1, 10, 30)), until: new Date(Date.UTC(2012, 12, 31)) }); and get...

Uncaught ReferenceError: RRule is not defined

What am I doing wrong?

chriscollins405 commented 4 years ago

Fixed it. https://jsfiddle.net/cpzeqk4r/