Skip to content

BYSETPOS not fully supported #795

Description

@minichma

BYSETPOS seems to be supported only for certain frequencies, i.e. for YEARLY and for MONTHLY (see #21) but seemingly not for others.

E.g. the following test case fails:

RRULE:FREQ=HOURLY;BYMINUTE=0,10,20,30,40,50;BYSETPOS=-2,3;INTERVAL=2;COUNT=5
DTSTART:20241023T154000
INSTANCES:20241023T154000,20241023T172000,20241023T174000,20241023T192000,20241023T194000

[Edit] Could also easily get something wrong. The RFC says

Valid values are 1 to 366 or -366 to -1.

This seems to imply that no time-related BY rules may be applied, therefore the above example would be wrong. However, the following example doesn't seem to work either:

RRULE:FREQ=WEEKLY;BYDAY=MO,TU,WE,TH,FR;BYSETPOS=1,3;COUNT=3
DTSTART:20241023
Expected INSTANCES:20241023,20241028,20241030
Actual   INSTANCES:20241023,20241024,20241025

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions