mirror of
https://github.com/taigrr/wtf
synced 2025-01-18 04:03:14 -08:00
WTF-33 gcal 'showAllDay' option added (#804)
When true, all-day events are displayed. When false, all-day events are not displayed. Defaults to true. Closes #733 Signed-off-by: Chris Cummer <chriscummer@me.com>
This commit is contained in:
parent
5f1aeec5ae
commit
cc169f1674
@ -33,6 +33,10 @@ func (widget *Widget) content() (string, string, bool) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
for _, calEvent := range calEvents {
|
for _, calEvent := range calEvents {
|
||||||
|
if calEvent.AllDay() && !widget.settings.showAllDay {
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
|
||||||
timestamp := fmt.Sprintf("[%s]%s", widget.eventTimeColor(calEvent), calEvent.Timestamp(widget.settings.hourFormat))
|
timestamp := fmt.Sprintf("[%s]%s", widget.eventTimeColor(calEvent), calEvent.Timestamp(widget.settings.hourFormat))
|
||||||
if calEvent.AllDay() {
|
if calEvent.AllDay() {
|
||||||
timestamp = ""
|
timestamp = ""
|
||||||
|
@ -33,6 +33,7 @@ type Settings struct {
|
|||||||
hourFormat string `help:"The format of the clock." values:"12 or 24"`
|
hourFormat string `help:"The format of the clock." values:"12 or 24"`
|
||||||
multiCalendar bool `help:"Whether or not to display your primary calendar or all calendars you have access to." values:"true or false" optional:"true"`
|
multiCalendar bool `help:"Whether or not to display your primary calendar or all calendars you have access to." values:"true or false" optional:"true"`
|
||||||
secretFile string `help:"Your Google client secret JSON file." values:"A string representing a file path to the JSON secret file."`
|
secretFile string `help:"Your Google client secret JSON file." values:"A string representing a file path to the JSON secret file."`
|
||||||
|
showAllDay bool `help:"Whether or not to display all-day events" values:"true or false" optional:"true" default:"true"`
|
||||||
showDeclined bool `help:"Whether or not to display events you’ve declined to attend." values:"true or false" optional:"true"`
|
showDeclined bool `help:"Whether or not to display events you’ve declined to attend." values:"true or false" optional:"true"`
|
||||||
withLocation bool `help:"Whether or not to show the location of the appointment." values:"true or false"`
|
withLocation bool `help:"Whether or not to show the location of the appointment." values:"true or false"`
|
||||||
timezone string `help:"The time zone used to display calendar event times." values:"A valid TZ database time zone string" optional:"true"`
|
timezone string `help:"The time zone used to display calendar event times." values:"A valid TZ database time zone string" optional:"true"`
|
||||||
@ -52,6 +53,7 @@ func NewSettingsFromYAML(name string, ymlConfig *config.Config, globalConfig *co
|
|||||||
hourFormat: ymlConfig.UString("hourFormat", "24"),
|
hourFormat: ymlConfig.UString("hourFormat", "24"),
|
||||||
multiCalendar: ymlConfig.UBool("multiCalendar", false),
|
multiCalendar: ymlConfig.UBool("multiCalendar", false),
|
||||||
secretFile: ymlConfig.UString("secretFile", ""),
|
secretFile: ymlConfig.UString("secretFile", ""),
|
||||||
|
showAllDay: ymlConfig.UBool("showAllDay", true),
|
||||||
showDeclined: ymlConfig.UBool("showDeclined", false),
|
showDeclined: ymlConfig.UBool("showDeclined", false),
|
||||||
withLocation: ymlConfig.UBool("withLocation", true),
|
withLocation: ymlConfig.UBool("withLocation", true),
|
||||||
timezone: ymlConfig.UString("timezone", ""),
|
timezone: ymlConfig.UString("timezone", ""),
|
||||||
|
Loading…
x
Reference in New Issue
Block a user