More algowhizbang that now almost matches manual calc
This commit is contained in:
parent
355e07cf53
commit
34d8e2dafb
@ -137,7 +137,7 @@ func main() {
|
||||
evt.Location = loc
|
||||
|
||||
if evt.Start == evt.End {
|
||||
log.Printf("skipping same-day event on %s", evt.Start)
|
||||
log.Printf("skipping same-day event on %s (%s)", evt.Start, evt.Summary)
|
||||
continue
|
||||
}
|
||||
foundEvents = append(foundEvents, evt)
|
||||
@ -151,6 +151,7 @@ func main() {
|
||||
for _, evt := range foundEvents {
|
||||
log.Printf("checking if %s is in range %s %s", day.Date, evt.Start, evt.End)
|
||||
if evt.HasDate(day.Date) {
|
||||
log.Printf("match found for %s in range %s %s, setting location to %s", day.Date, evt.Start, evt.End, evt.Location)
|
||||
day.Location = evt.Location
|
||||
}
|
||||
}
|
||||
@ -236,8 +237,8 @@ type lilEvent struct {
|
||||
}
|
||||
|
||||
func (e *lilEvent) HasDate(d string) bool {
|
||||
if e.Start == d || e.End == d {
|
||||
log.Printf("match for %s in %s or %s", d, e.Start, e.End)
|
||||
if e.Start == d {
|
||||
log.Printf("match for %s at %s", d, e.Start)
|
||||
return true
|
||||
}
|
||||
|
||||
@ -273,12 +274,7 @@ type lilDay struct {
|
||||
|
||||
func generateDays(startT, endT time.Time) []*lilDay {
|
||||
defaultLocation := *defaultLocationFlag
|
||||
days := []*lilDay{
|
||||
{
|
||||
Date: startT.Format(dateFmt),
|
||||
Location: defaultLocation,
|
||||
},
|
||||
}
|
||||
days := []*lilDay{}
|
||||
|
||||
curT := startT
|
||||
for {
|
||||
|
Loading…
Reference in New Issue
Block a user