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

Rule not working as intended. It could be my problem too. New to rrule. #393

Closed akspan12 closed 4 years ago

akspan12 commented 4 years ago

I am using this string to create a rule
DTSTART:20200414T080000Z;RRULE:FREQ=DAILY;INTERVAL=1;UNTIL=20200420T080000Z Here is the code snippet.

let rruleString = 'DTSTART:20200414T080000Z;RRULE:FREQ=DAILY;INTERVAL=1;UNTIL=20200420T080000Z';
console.log("rule string --->", rruleString);
let rules = rrulestr(rruleString);
console.log("rules -->", rules.all());

This rule in English is supposed to mean -

"Run daily, 1 time from 14th April till 20th April at 08:00 AM UTC."

But the output of rules.all() contain a large number of records. I am not able to understand, where I am wrong. Please help. THANK YOU!

cmditch commented 4 years ago

rule.all() will get all occurrence dates of a given RRule or RRuleSet, returned as a Date[].

If you're looking for the english description of your rrule, give rrule.toText() a go.