Explorar el Código

指标期数位移-bug修改

gmy hace 5 meses
padre
commit
f130324672
Se han modificado 1 ficheros con 1 adiciones y 1 borrados
  1. 1 1
      utils/common.go

+ 1 - 1
utils/common.go

@@ -1603,7 +1603,7 @@ func CalculateDekadTime(baseDate time.Time, tradingDays, moveType int) int {
 
 	// 计算时间差
 	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)