mirror of
https://github.com/Xevion/glance.git
synced 2025-12-15 00:11:53 -06:00
Merge pull request #267 from xendke/calendar-start-day
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