|
@@ -374,6 +374,15 @@ func getPredictEdbDayList(startDate, endDate time.Time, frequency string) (dayLi
|
|
|
for currDate := startDate.AddDate(0, 0, 7); currDate.Before(endDate) || currDate.Equal(endDate); currDate = currDate.AddDate(0, 0, 7) {
|
|
|
dayList = append(dayList, currDate)
|
|
|
}
|
|
|
+ case "旬度":
|
|
|
+ for currDate := startDate.AddDate(0, 0, 1); currDate.Before(endDate) || currDate.Equal(endDate); {
|
|
|
+ nextDate := currDate.AddDate(0, 0, 1)
|
|
|
+ //每个月的10号、20号、最后一天,那么就写入
|
|
|
+ if nextDate.Day() == 11 || nextDate.Day() == 21 || nextDate.Day() == 1 {
|
|
|
+ dayList = append(dayList, currDate)
|
|
|
+ }
|
|
|
+ currDate = nextDate
|
|
|
+ }
|
|
|
case "月度":
|
|
|
for currDate := startDate; currDate.Before(endDate) || currDate.Equal(endDate); {
|
|
|
currDate = time.Date(currDate.Year(), currDate.Month(), 1, 0, 0, 0, 0, time.Now().Location()).AddDate(0, 1, -1)
|
|
@@ -382,6 +391,30 @@ func getPredictEdbDayList(startDate, endDate time.Time, frequency string) (dayLi
|
|
|
}
|
|
|
currDate = currDate.AddDate(0, 0, 1)
|
|
|
}
|
|
|
+ case "季度":
|
|
|
+ for currDate := startDate; currDate.Before(endDate) || currDate.Equal(endDate); {
|
|
|
+ // 每月的最后一天
|
|
|
+ currDate = time.Date(currDate.Year(), currDate.Month(), 1, 0, 0, 0, 0, time.Now().Location()).AddDate(0, 1, -1)
|
|
|
+ if !currDate.After(endDate) && !currDate.Equal(startDate) {
|
|
|
+ // 季度日期就写入,否则不写入
|
|
|
+ if currDate.Month() == 3 || currDate.Month() == 6 || currDate.Month() == 9 || currDate.Month() == 12 {
|
|
|
+ dayList = append(dayList, currDate)
|
|
|
+ }
|
|
|
+ }
|
|
|
+ currDate = currDate.AddDate(0, 0, 1)
|
|
|
+ }
|
|
|
+ case "半年度":
|
|
|
+ for currDate := startDate; currDate.Before(endDate) || currDate.Equal(endDate); {
|
|
|
+ // 每月的最后一天
|
|
|
+ currDate = time.Date(currDate.Year(), currDate.Month(), 1, 0, 0, 0, 0, time.Now().Location()).AddDate(0, 1, -1)
|
|
|
+ if !currDate.After(endDate) && !currDate.Equal(startDate) {
|
|
|
+ // 半年度日期就写入,否则不写入
|
|
|
+ if currDate.Month() == 6 || currDate.Month() == 12 {
|
|
|
+ dayList = append(dayList, currDate)
|
|
|
+ }
|
|
|
+ }
|
|
|
+ currDate = currDate.AddDate(0, 0, 1)
|
|
|
+ }
|
|
|
case "年度":
|
|
|
for currDate := startDate; currDate.Before(endDate) || currDate.Equal(endDate); {
|
|
|
currDate = time.Date(currDate.Year()+1, 12, 31, 0, 0, 0, 0, time.Now().Location())
|