Small code formatting correction

This commit is contained in:
2024-01-18 11:36:33 -06:00
parent b9faf991f2
commit 6267a80fea
2 changed files with 9 additions and 9 deletions

View File

@@ -28,7 +28,7 @@ var (
isDevelopment bool isDevelopment bool
baseURL string // Base URL for all requests to the banner system baseURL string // Base URL for all requests to the banner system
environment string environment string
CentralTime *time.Location centralTime *time.Location
) )
func init() { func init() {
@@ -40,14 +40,14 @@ func init() {
ctx = context.Background() ctx = context.Background()
var err error var err error
CentralTime, err = time.LoadLocation("America/Chicago") centralTime, err = time.LoadLocation("America/Chicago")
if err != nil { if err != nil {
panic(err) panic(err)
} }
// Set zerolog's timestamp function to use the central timezone // Set zerolog's timestamp function to use the central timezone
zerolog.TimestampFunc = func() time.Time { zerolog.TimestampFunc = func() time.Time {
return time.Now().In(CentralTime) return time.Now().In(centralTime)
} }
// Try to grab the environment variable, or default to development // Try to grab the environment variable, or default to development

12
term.go
View File

@@ -46,12 +46,12 @@ type YearDayRange struct {
// Summer: May 25th - August 15th // Summer: May 25th - August 15th
// Fall: August 18th - December 10th // Fall: August 18th - December 10th
func GetYearDayRange(year uint16) (YearDayRange, YearDayRange, YearDayRange) { func GetYearDayRange(year uint16) (YearDayRange, YearDayRange, YearDayRange) {
springStart := time.Date(int(year), time.January, 14, 0, 0, 0, 0, CentralTime).YearDay() springStart := time.Date(int(year), time.January, 14, 0, 0, 0, 0, centralTime).YearDay()
springEnd := time.Date(int(year), time.May, 1, 0, 0, 0, 0, CentralTime).YearDay() springEnd := time.Date(int(year), time.May, 1, 0, 0, 0, 0, centralTime).YearDay()
summerStart := time.Date(int(year), time.May, 25, 0, 0, 0, 0, CentralTime).YearDay() summerStart := time.Date(int(year), time.May, 25, 0, 0, 0, 0, centralTime).YearDay()
summerEnd := time.Date(int(year), time.August, 15, 0, 0, 0, 0, CentralTime).YearDay() summerEnd := time.Date(int(year), time.August, 15, 0, 0, 0, 0, centralTime).YearDay()
fallStart := time.Date(int(year), time.August, 18, 0, 0, 0, 0, CentralTime).YearDay() fallStart := time.Date(int(year), time.August, 18, 0, 0, 0, 0, centralTime).YearDay()
fallEnd := time.Date(int(year), time.December, 10, 0, 0, 0, 0, CentralTime).YearDay() fallEnd := time.Date(int(year), time.December, 10, 0, 0, 0, 0, centralTime).YearDay()
return YearDayRange{ return YearDayRange{
Start: uint16(springStart), Start: uint16(springStart),