Teensy name change eh
This commit is contained in:
parent
79e6c7f48e
commit
b63a044965
@ -25,7 +25,7 @@ var (
|
|||||||
calendarIDFlag = flag.String(
|
calendarIDFlag = flag.String(
|
||||||
"i", getEnvDefault("CALENDAR", "primary"), "calendar ID to search")
|
"i", getEnvDefault("CALENDAR", "primary"), "calendar ID to search")
|
||||||
endTimeFlag = flag.String(
|
endTimeFlag = flag.String(
|
||||||
"e", getEnvDefault("END_TIME", nowTime.Format(dateFmt)), "end time for search")
|
"e", getEnvDefault("END_TIME", nowTime.Format(ymdFmt)), "end time for search")
|
||||||
timeWindowFlag = flag.Duration(
|
timeWindowFlag = flag.Duration(
|
||||||
"t", func() time.Duration {
|
"t", func() time.Duration {
|
||||||
stringVal := getEnvDefault("DURATION", oneYearString)
|
stringVal := getEnvDefault("DURATION", oneYearString)
|
||||||
@ -44,7 +44,7 @@ var (
|
|||||||
)
|
)
|
||||||
|
|
||||||
const (
|
const (
|
||||||
dateFmt = "2006-01-02"
|
ymdFmt = "2006-01-02"
|
||||||
)
|
)
|
||||||
|
|
||||||
func getEnvDefault(key, defVal string) string {
|
func getEnvDefault(key, defVal string) string {
|
||||||
@ -69,7 +69,7 @@ func (e *lilEvent) HasDate(d string) bool {
|
|||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
|
|
||||||
dT, err := time.Parse(dateFmt, d)
|
dT, err := time.Parse(ymdFmt, d)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
logrus.Error(err)
|
logrus.Error(err)
|
||||||
return false
|
return false
|
||||||
@ -82,7 +82,7 @@ func (e *lilEvent) HasDate(d string) bool {
|
|||||||
func (e *lilEvent) dateRange() []time.Time {
|
func (e *lilEvent) dateRange() []time.Time {
|
||||||
ret := []time.Time{}
|
ret := []time.Time{}
|
||||||
for _, t := range []string{e.Start, e.End} {
|
for _, t := range []string{e.Start, e.End} {
|
||||||
parsedDate, err := time.Parse(dateFmt, t)
|
parsedDate, err := time.Parse(ymdFmt, t)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
logrus.Error(err)
|
logrus.Error(err)
|
||||||
ret = append(ret, time.Time{})
|
ret = append(ret, time.Time{})
|
||||||
@ -110,7 +110,7 @@ func generateDays(startT, endT time.Time) []*lilDay {
|
|||||||
}
|
}
|
||||||
|
|
||||||
days = append(days, &lilDay{
|
days = append(days, &lilDay{
|
||||||
Date: curT.Format(dateFmt),
|
Date: curT.Format(ymdFmt),
|
||||||
Location: defaultLocation,
|
Location: defaultLocation,
|
||||||
})
|
})
|
||||||
|
|
||||||
@ -150,7 +150,7 @@ func main() {
|
|||||||
logrus.Fatalf("Unable to retrieve calendar Client %v", err)
|
logrus.Fatalf("Unable to retrieve calendar Client %v", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
endT, err := time.Parse(dateFmt, *endTimeFlag)
|
endT, err := time.Parse(ymdFmt, *endTimeFlag)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
logrus.Fatalf("Unable to parse end time %q: %v", *endTimeFlag, err)
|
logrus.Fatalf("Unable to parse end time %q: %v", *endTimeFlag, err)
|
||||||
}
|
}
|
||||||
@ -213,8 +213,8 @@ func main() {
|
|||||||
logrus.Errorf("error parsing end date: %v", err)
|
logrus.Errorf("error parsing end date: %v", err)
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
startDate = startT.Format(dateFmt)
|
startDate = startT.Format(ymdFmt)
|
||||||
endDate = endT.Format(dateFmt)
|
endDate = endT.Format(ymdFmt)
|
||||||
} else {
|
} else {
|
||||||
startDate = i.Start.Date
|
startDate = i.Start.Date
|
||||||
endDate = i.End.Date
|
endDate = i.End.Date
|
||||||
|
Loading…
Reference in New Issue
Block a user