浏览代码

兼容无效指标的情况

hsun 7 月之前
父节点
当前提交
16c674d900
共有 1 个文件被更改,包括 6 次插入12 次删除
  1. 6 12
      watch/watch.go

+ 6 - 12
watch/watch.go

@@ -215,22 +215,18 @@ func HandleIndexFile(filePath string) {
 							_, e := time.ParseInLocation(utils.FormatDate, dateArr[0], time.Local)
 							if e != nil {
 								st, e := utils.AppendMonthDayFromDiffDate(dateArr[0])
-								if e != nil {
-									fmt.Printf("AppendEndDayFromStrMonthDate1 strDate: %s, Err:%v\n", colCell, e)
-									return
+								if e == nil {
+									startDateMap[k-1] = st
 								}
-								startDateMap[k-1] = st
 							}
 
 							endDateMap[k-1] = dateArr[1]
 							_, e = time.ParseInLocation(utils.FormatDate, dateArr[1], time.Local)
 							if e != nil {
 								ed, e := utils.AppendMonthDayFromDiffDate(dateArr[1])
-								if e != nil {
-									fmt.Printf("AppendEndDayFromStrMonthDate2 strDate: %s, Err:%v\n", colCell, e)
-									return
+								if e == nil {
+									endDateMap[k-1] = ed
 								}
-								endDateMap[k-1] = ed
 							}
 						}
 					case 7: //备注
@@ -248,11 +244,9 @@ func HandleIndexFile(filePath string) {
 						_, e := time.ParseInLocation(utils.FormatDate, date, time.Local)
 						if e != nil {
 							d, e := utils.AppendMonthDayFromDiffDate(date)
-							if e != nil {
-								fmt.Printf("AppendEndDayFromStrMonthDate3 strDate: %s, Err:%v\n", col, e)
-								return
+							if e == nil {
+								date = d
 							}
-							date = d
 						}
 						continue
 					}