list(rrule.between(start,last,inc=True)) is not including the start date

39 Views Asked by At
RRULE:FREQ=WEEKLY;UNTIL=20231214T170000Z;INTERVAL=1;BYDAY=TH;WKST=SU

Converted the RRULE to string using

.decode(utf-8)
rrule=rrulestr(rrule_str)

The list of dates doesn't include the start date when I use

list(rrule.between(start,last,inc=True))

but includes the last. Sometimes it does include the start but then it excludes the last.

This is an example: start=2023-06-28 15:04:16+00:00 last=2023-12-14 15:04:16+00:00 mlist=list(rrule.between(start.astimezone(pytz.utc),last.astimezone(pytz.utc),inc=True))

Output list doesn't contain start at times and contains the last. Sometimes it contains the start and doesn't output the last although it should be giving both as per the documentation.

0

There are 0 best solutions below