Browse Source

Merge branch 'eta_2.1.9_index_phase_shift_0909@guomengyuan' into debug

gmy 6 months ago
parent
commit
584cb0b168
1 changed files with 1 additions and 1 deletions
  1. 1 1
      utils/common.go

+ 1 - 1
utils/common.go

@@ -1614,7 +1614,7 @@ func CalculateDekadTime(baseDate time.Time, tradingDays, moveType int) int {
 
 
 	// 计算时间差
 	// 计算时间差
 	subDays := baseDate.Sub(oldDate)
 	subDays := baseDate.Sub(oldDate)
-	days := int(subDays.Hours() / 24)
+	days := int(math.Abs(subDays.Hours() / 24))
 
 
 	fmt.Printf("最终日期: %s, 总天数差: %d 天\n", baseDate.Format("2006-01-02"), days)
 	fmt.Printf("最终日期: %s, 总天数差: %d 天\n", baseDate.Format("2006-01-02"), days)