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.28k stars 510 forks source link

Showing Invalid UNTIL Value if there is DTSTART #463

Open rizalrhmn opened 3 years ago

rizalrhmn commented 3 years ago

I found this issue : https://github.com/jakubroztocil/rrule/issues/83 but it says that it already solved.

`exports.rRuleGetOccurrenceDates = async (pattern, queryStartDate, queryEndDate, maxCount) => { try { if (!queryStartDate) { queryStartDate = new Date(); queryStartDate = new Date(queryStartDate.setUTCFullYear(queryStartDate.getUTCFullYear() - 1)); }

    if (!queryEndDate) {
        queryEndDate = new Date();
        queryEndDate = new Date (queryEndDate.setUTCFullYear(queryEndDate.getUTCFullYear() + 1));
    }

    queryStartDate.setUTCHours(0)
    queryStartDate.setUTCMinutes(0, 0, 0)
    queryEndDate.setUTCHours(0)
    queryEndDate.setUTCMinutes(0, 0, 0);

    if (!maxCount) {
        maxCount = 250;
    }

    const rule = rrulestr(`${pattern};COUNT=${maxCount}`);

    return rule.between(queryStartDate, queryEndDate);
} catch (err) {
    throw err
}

}`

Showing error : Invalid UNTIL value: 20120201T093000Z\nRRULE:FREQ=WEEKLY

Trying to copy this value to website https://jakubroztocil.github.io/rrule/ also showing same error : DTSTART:20120201T093000Z\nRRULE:FREQ=WEEKLY;COUNT=10

msageryd commented 10 months ago

Could this be a simple input string problem? See: #601