Browse Source

update

master
public_host 6 months ago
parent
commit
83068e469c
  1. 12
      core.go

12
core.go

@ -503,36 +503,48 @@ func (th *TimeArrowHelper) GetHitTimeArrow(t time.Time, group string, expandTags
case TimeArrowTypeDayOfWeek:
//一周中某一天是否判定
if isInWeekOfDay(t, ta[e]) {
log.Println("命中DayOfWeek:", ta[e].Type, ta[e].TimeArrowId)
log.Println("for循环耗时:", time.Since(forStart))
return &ta[e], nil
}
break
case TimeArrowTypeDayOfMonth:
//一月中某一天是否判定
if isInDayOfMonth(t, ta[e]) {
log.Println("命中DayOfMonth:", ta[e].Type, ta[e].TimeArrowId)
log.Println("for循环耗时:", time.Since(forStart))
return &ta[e], nil
}
break
case TimeArrowTypeDateSlice:
//一月中某一天是否判定
if isInDateSlice(t, ta[e]) {
log.Println("命中DateSlice:", ta[e].Type, ta[e].TimeArrowId)
log.Println("for循环耗时:", time.Since(forStart))
return &ta[e], nil
}
break
case TimeArrowTypeAtLastDayHolidays:
//节假日最后一天
if isInAtLastDayHolidays(t) {
log.Println("命中AtLastDayHolidays:", ta[e].Type, ta[e].TimeArrowId)
log.Println("for循环耗时:", time.Since(forStart))
return &ta[e], nil
}
break
case TimeArrowTypePriorToDayHolidays:
//节假日前一天
if isInPriorToDayHolidays(t) {
log.Println("命中PriorToDayHolidays:", ta[e].Type, ta[e].TimeArrowId)
log.Println("for循环耗时:", time.Since(forStart))
return &ta[e], nil
}
break
case TimeArrowTypeInHolidays:
//节假日
if isInHolidays(t) {
log.Println("命中InHolidays:", ta[e].Type, ta[e].TimeArrowId)
log.Println("for循环耗时:", time.Since(forStart))
return &ta[e], nil
}
break

Loading…
Cancel
Save