-
Notifications
You must be signed in to change notification settings - Fork 57
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
rrrule#All() generates wrong recurrences around DST #59
Comments
It works well on my computer: package main
import (
"fmt"
"time"
"github.com/teambition/rrule-go"
)
func main() {
rule, _ := rrule.NewRRule(rrule.ROption{
Freq: rrule.HOURLY,
Dtstart: time.Date(2023, time.March, 26, 1, 30, 0, 0, time.Local),
Until: time.Date(2023, time.March, 26, 5, 0, 0, 0, time.Local),
})
recurrences := rule.All()
fmt.Println(recurrences)
// [2023-03-26 01:30:00 +0800 CST 2023-03-26 02:30:00 +0800 CST 2023-03-26 03:30:00 +0800 CST 2023-03-26 04:30:00 +0800 CST]
} |
From the outputs you provided, there is no DST changes on your computer. Otherwise, the
|
Some underlying code used UTC, Maybe you should do: rule, _ := rrule.NewRRule(rrule.ROption{
Freq: rrule.HOURLY,
Dtstart: time.Date(2023, time.March, 26, 1, 30, 0, 0, time.UTC),
Until: time.Date(2023, time.March, 26, 5, 0, 0, 0, time.UTC),
}) And then convert the results to CEST time |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Describe the bug
teambition/rrule-go version:
v1.8.2
rrule#All()
is generating duplicate events for the same date time during DST changes.To Reproduce
Code to reproduce the behavior:
Expected behavior
Don't duplicate events.
Screenshots
If applicable, add screenshots to help explain your problem.
Additional context
Add any other context about the problem here.
The text was updated successfully, but these errors were encountered: