You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've been looking through the rrule repo for this as well, but so far haven't figured out where the discrepancy comes from that I am encountering. I have the following ics:
event.start.utc() gives me 17 for the hour (true), while event.rrule.all()[0].getUTCHours() gives me 15.
The former is correct. It seems somehow that the rule UTC offset is applies twice? Could that be?
constdates=event.rrule.between(newDate(2022,0,1,0,0,0,0),newDate(2022,11,31,0,0,0,0))if(dates.length===0)continue;console.log('Summary:',event.summary);console.log('Original start:',event.start);console.log('RRule start:',`${event.rrule.origOptions.dtstart} [${event.rrule.origOptions.tzid}]`)dates.forEach(date=>{letnewDateif(event.rrule.origOptions.tzid){// tzid present (calculate offset from recurrence start)constdateTimezone=moment.tz.zone('UTC')constlocalTimezone=moment.tz.guess()consttz=event.rrule.origOptions.tzid===localTimezone ? event.rrule.origOptions.tzid : localTimezoneconsttimezone=moment.tz.zone(tz)constoffset=timezone.utcOffset(date)-dateTimezone.utcOffset(date)newDate=moment(date).add(offset,'minutes').toDate()}else{// tzid not present (calculate offset from original start)newDate=newDate(date.setHours(date.getHours()-((event.start.getTimezoneOffset()-date.getTimezoneOffset())/60)))}conststart=moment(newDate)console.log('Recurrence start:',start)})
Result
Here you see that the Original start and UTC RRule start are 22 June 17:00:00, yet the three recurrences start at 15:00:00 UTC.
2022-08-20T12:50:28.775Z f63d18df-c840-418e-9389-8731a38f7b73 INFO Summary: Test recurring end date
2022-08-20T12:50:28.776Z f63d18df-c840-418e-9389-8731a38f7b73 INFO Original start: 2022-06-22T17:00:00.000Z { tz: 'Europe/Amsterdam' }
2022-08-20T12:50:28.777Z f63d18df-c840-418e-9389-8731a38f7b73 INFO RRule start: Wed Jun 22 2022 17:00:00 GMT+0000 (Coordinated Universal Time) [Europe/Amsterdam]
2022-08-20T12:50:29.137Z f63d18df-c840-418e-9389-8731a38f7b73 INFO Recurrence start: Moment<2022-06-22T15:00:00+00:00>
2022-08-20T12:50:29.137Z f63d18df-c840-418e-9389-8731a38f7b73 INFO Recurrence start: Moment<2022-06-23T15:00:00+00:00>
2022-08-20T12:50:29.137Z f63d18df-c840-418e-9389-8731a38f7b73 INFO Recurrence start: Moment<2022-06-24T15:00:00+00:00>
I've been looking through the rrule repo for this as well, but so far haven't figured out where the discrepancy comes from that I am encountering. I have the following ics:
event.start.utc()
gives me 17 for the hour (true), whileevent.rrule.all()[0].getUTCHours()
gives me 15.The former is correct. It seems somehow that the rule UTC offset is applies twice? Could that be?
Tldr; example RRule from docs
Example code from the docs
Result
Here you see that the Original start and UTC RRule start are 22 June 17:00:00, yet the three recurrences start at 15:00:00 UTC.
Dump of
event.rrule
The text was updated successfully, but these errors were encountered: