mirror of
https://github.com/Xevion/glance.git
synced 2025-12-09 18:07:15 -06:00
optionally start calendar weeks on sunday
This commit is contained in:
@@ -10,8 +10,9 @@ import (
|
||||
)
|
||||
|
||||
type Calendar struct {
|
||||
widgetBase `yaml:",inline"`
|
||||
Calendar *feed.Calendar
|
||||
widgetBase `yaml:",inline"`
|
||||
Calendar *feed.Calendar
|
||||
StartSunday bool `yaml:"start-sunday"`
|
||||
}
|
||||
|
||||
func (widget *Calendar) Initialize() error {
|
||||
@@ -21,7 +22,7 @@ func (widget *Calendar) Initialize() error {
|
||||
}
|
||||
|
||||
func (widget *Calendar) Update(ctx context.Context) {
|
||||
widget.Calendar = feed.NewCalendar(time.Now())
|
||||
widget.Calendar = feed.NewCalendar(time.Now(), widget.StartSunday)
|
||||
widget.withError(nil).scheduleNextUpdate()
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user