KIRshould be west of the International date line from 1995, i.e. 2 Jan in the test.
'RRULE UNTIL values must be specified in UTC when DTSTART is timezone-aware', but here the
UNTILvalue is in UTC, while
Was hoping to get a bit of feedback on designing a
rrule. I'm wondering what the best way to create a minutely rule is but omit entire days. So for example get 5 minute intervals every weekday between some time but omit certain holidays. I thought of using something like
INTERVAL = 5 BUCKETS = int(60 / INTERVAL * 24) WEEKDAYS = (MO, TU, WE, TH, FR) nyd = rrule(MONTHLY, dtstart=datetime(2019, 1, 1, 0, 0), bymonth=1, byminute=range(0, 59, INTERVAL), byhour=range(0,24), bysetpos=range(1, BUCKETS + 1), byweekday=WEEKDAYS, count=300)
which works, but I'm wondering if this is some non recommended hackery. The reason I ask is because
bysetpos only supports values up until 366. For minutely and secondly data you could have situations where you want to use
bysetpos up to 1440 and 86400 respectively, so I'm wondering if
bysetpos is not intended for this use?
INTERVAL = 5 BUCKETS = int(60 / INTERVAL * 24) WEEKDAYS = (MO, TU, WE, TH, FR) rrule_base = rrule(MINUTELY, dtstart=datetime(2019, 1, 1, 0, 0), count=300, byweekday=WEEKDAYS) rrset = rruleset() rrset.rrule(rrule_base) for dt in holidays: rrset.exrule(rrule_base.replace(dtstart=dt, until=(dt + timedelta(days=1)), count=None))
for dt in holidays: for inst in rrule_base.between(dt, dt + timedelta(days=1)): rrset.exdate(inst)