Skip to content

Commit 54221ef

Browse files
authored
fix(maintenance): Import time/tzdata to support timezones (#849)
Fix #848
1 parent d04b689 commit 54221ef

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

config/maintenance/maintenance.go

+4-3
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import (
66
"strconv"
77
"strings"
88
"time"
9+
_ "time/tzdata" // Required for IANA timezone support
910
)
1011

1112
var (
@@ -52,7 +53,7 @@ func GetDefaultConfig() *Config {
5253
}
5354

5455
// IsEnabled returns whether maintenance is enabled or not
55-
func (c Config) IsEnabled() bool {
56+
func (c *Config) IsEnabled() bool {
5657
if c.Enabled == nil {
5758
return true
5859
}
@@ -101,7 +102,7 @@ func (c *Config) ValidateAndSetDefaults() error {
101102
}
102103

103104
// IsUnderMaintenance checks whether the endpoints that Gatus monitors are within the configured maintenance window
104-
func (c Config) IsUnderMaintenance() bool {
105+
func (c *Config) IsUnderMaintenance() bool {
105106
if !c.IsEnabled() {
106107
return false
107108
}
@@ -127,7 +128,7 @@ func (c Config) IsUnderMaintenance() bool {
127128
return now.After(startOfMaintenancePeriod) && now.Before(endOfMaintenancePeriod)
128129
}
129130

130-
func (c Config) hasDay(day string) bool {
131+
func (c *Config) hasDay(day string) bool {
131132
for _, d := range c.Every {
132133
if d == day {
133134
return true

0 commit comments

Comments
 (0)