Comments (3)
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 rrule-go.
It works well on my computer:
From the outputs you provided, there is no DST changes on your computer. Otherwise, the 02:30
event wouldn't have appeared there. For comparison on my end (Mac Ventura), here's what it looks like. I just used the exact same program.
[
2023-03-26 01:30:00 +0100 CET // Before 2 am, so no DST change
2023-03-26 03:30:00 +0200 CEST // This is supposed to be 02:30, but there is no such time due to the daylight saving time change at 02:00.
2023-03-26 03:30:00 +0200 CEST // The same event as the previous one
2023-03-26 04:30:00 +0200 CEST
]
from rrule-go.
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
from rrule-go.
Related Issues (20)
- rrule.DTStart() not working as expected
- How to check if two RRules overlapping HOT 1
- UNTIL function is not working
- RRule.DTStart 函数实现有bug
- StrToRule doesn't follow RFC5545 HOT 1
- StrToRRule Does Not Apply Timezone to UNTIL and treats it as UTC HOT 1
- After generating a rule from a string, rule.DTStart does not work as expected [has workaround]
- set.After() works incorrect if timestamp has milliseconds HOT 3
- ExRule removed - but still shown in README HOT 1
- Behavior change in rrule.Set.Between from v1.5.0 to v1.6.0 HOT 2
- rruleset.After(time.Now()) with count 1 returns zero time value HOT 1
- Get last event time HOT 1
- Validating rrule HOT 1
- Is there anyway to see the `Before` relative to the `DTStart` HOT 1
- Wrong time for events far into the future HOT 2
- Nanoseconds in DTSTART breaks between method HOT 6
- 2.29 Not present HOT 3
- Question: Timezone conversion HOT 1
- Invalid timestamps for `HOURLY` interval RRULEs when DST change occurs HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from rrule-go.