teambition / rrule-go

Go library for working with recurrence rules for calendar dates.
MIT License
314 stars 58 forks source link

Behavior change in rrule.Set.Between from v1.5.0 to v1.6.0 #42

Closed matthewloring closed 4 years ago

matthewloring commented 4 years ago

Go Version: 1.15.2 Test Case:

s := []string{"DTSTART;20100123T100000Z", "RRULE:FREQ=YEARLY"}
set, err := rrule.StrSliceToRRuleSet(s)
if err != nil {
    log.Fatal(err)
}
after := time.Date(2010, time.January, 23, 10, 0, 0, 0, time.UTC)
before := time.Date(2012, time.January, 23, 10, 0, 0, 0, time.UTC)
fmt.Printf("%+v\n", set.Between(after, before, true))

Output using rrule-go@v1.5.0: [2010-01-23 10:00:00 +0000 UTC 2011-01-23 10:00:00 +0000 UTC 2012-01-23 10:00:00 +0000 UTC] Output using rrule-go@v1.6.0: [2010-01-23 10:00:00 +0000 UTC 2011-01-13 10:00:00 +0000 UTC 2011-01-23 10:00:00 +0000 UTC 2012-01-13 10:00:00 +0000 UTC 2012-01-23 10:00:00 +0000 UTC]

With the latest release, we are now observing some events within 10 days of each other when using FREQ=YEARLY.

zensh commented 4 years ago

fixed on v1.6.1, thank you.

matthewloring commented 4 years ago

Thank you for the quick fix and release!!