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