Closed CubicrootXYZ closed 2 years ago
I have run your case, there is nothing wrong:
package main
import (
"fmt"
"time"
"github.com/teambition/rrule-go"
)
func main() {
rruleset, _ := rrule.StrToRRuleSet("DTSTART:21500918T143000Z\nRRULE:FREQ=WEEKLY;BYDAY=MO")
t := time.Date(2150, 9, 18, 14, 30, 0, 0, time.UTC)
fmt.Println(rruleset.After(t, false))
// 2150-09-21 14:30:00 +0000 UTC
}
Ah it works as soon as I pass the DTSTART
attribute to the rrule too. Makes sense since otherwise the it can not know the actual start, but it is as far as I can see not mentioned in the documentation. Might be worth adding it there.
Thanks a lot for looking into this and helping me out.
I am parsing this event:
And then calling
rruleObj.After(refTime, false)
whererefTime
is the start of the event, so 2150-09-18 14:30. The result I am getting is 2150-09-21 15:19:41. But I'd expect it to be 2150-09-21 14:30:00.The actual implementation is a testcase for a bot of me: https://github.com/CubicrootXYZ/RemindMe/blob/%2370-add-recurring-events/internal/icalimporter/icalimporter_test.go#L37.
Maybe there is sth. going wrong with leap years? Or my event is malformed? I'd appreciate any help on this topic.