mirror of
https://github.com/therootcompany/golib.git
synced 2025-11-20 05:54:29 +00:00
f: feat(calendar): calculate fixed and floating yearl and monthly events
This commit is contained in:
parent
ef7c9fb209
commit
b811f0863d
@ -286,4 +286,13 @@ func main() {
|
|||||||
for _, ev := range events {
|
for _, ev := range events {
|
||||||
fmt.Printf("%s → %s\n", ev.Time.Format(time.RFC3339), ev.Rule.Event)
|
fmt.Printf("%s → %s\n", ev.Time.Format(time.RFC3339), ev.Rule.Event)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fmt.Println()
|
||||||
|
for _, ev := range events {
|
||||||
|
sleep := time.Until(ev.Time.Add(-2 * time.Hour))
|
||||||
|
fmt.Printf("waiting %s for %s (%s)\n", sleep, ev.Rule.Event, ev.Time.Format(time.RFC3339))
|
||||||
|
if sleep > 0 {
|
||||||
|
time.Sleep(sleep)
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user