提交 c8e15a21 authored 作者: fit2cloud-chenyw's avatar fit2cloud-chenyw

fix: 日期范围动态时间季度错误

上级 a85d1d4b
...@@ -125,7 +125,8 @@ class TimeDateRangeServiceImpl extends WidgetService { ...@@ -125,7 +125,8 @@ class TimeDateRangeServiceImpl extends WidgetService {
getEndQuarter() { getEndQuarter() {
var now = new Date() var now = new Date()
var nowMonth = now.getMonth() var nowMonth = now.getMonth()
const endMonth = Math.floor((nowMonth / 3)) * 3 + (nowMonth % 3) const quar = Math.floor(nowMonth / 3)
const endMonth = quar * 3 + 2
const days = (endMonth === 5 || endMonth === 8) ? 30 : 31 const days = (endMonth === 5 || endMonth === 8) ? 30 : 31
return new Date(now.getFullYear(), endMonth, days) return new Date(now.getFullYear(), endMonth, days)
} }
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论