1
0
mirror of https://github.com/taigrr/wtf synced 2026-03-30 09:25:17 -07:00

WTF-665 Add time format setting for gCal module

Allows the user to specify either "12" or "24" to set whether or not to
display times in AM/PM format or 24-hour format.

Example:

      gcal:
        enabled: true
        timeFormat: "12"
        refreshInterval: 360

Fixes #665
This commit is contained in:
Chris Cummer
2019-10-01 21:34:52 -07:00
parent 301eddafd4
commit 7c2d6b4c42
5 changed files with 17 additions and 8 deletions

View File

@@ -30,6 +30,7 @@ type Settings struct {
displayResponseStatus bool `help:"Whether or not to display your response status to the calendar event." values:"true or false" optional:"true"`
email string `help:"The email address associated with your Google account. Necessary for determining 'responseStatus'." values:"A valid email address string."`
eventCount int `help:"The number of calendar events to display." values:"A positive integer, 0..n." optional:"true"`
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"`
secretFile string `help:"Your Google client secret JSON file." values:"A string representing a file path to the JSON secret file."`
showDeclined bool `help:"Whether or not to display events youve declined to attend." values:"true or false" optional:"true"`
@@ -48,6 +49,7 @@ func NewSettingsFromYAML(name string, ymlConfig *config.Config, globalConfig *co
displayResponseStatus: ymlConfig.UBool("displayResponseStatus", true),
email: ymlConfig.UString("email", ""),
eventCount: ymlConfig.UInt("eventCount", 10),
hourFormat: ymlConfig.UString("hourFormat", "24"),
multiCalendar: ymlConfig.UBool("multiCalendar", false),
secretFile: ymlConfig.UString("secretFile", ""),
showDeclined: ymlConfig.UBool("showDeclined", false),