|
@@ -64,13 +64,25 @@ export const dateCollections = [
|
|
|
end_time: dayjs().add(-1, 'month').endOf('month').format('YYYY-MM-DD HH:mm:ss')
|
|
|
},
|
|
|
{
|
|
|
- name: '本季度',
|
|
|
- start_time: dayjs().month(0).format('YYYY-MM-DD HH:mm:ss'),
|
|
|
- end_time: dayjs().month(2).endOf('month').format('YYYY-MM-DD HH:mm:ss')
|
|
|
+ name: "本季度",
|
|
|
+ start_time: dayjs()
|
|
|
+ .month(Math.floor(dayjs().month() / 3) * 3) // 当前季度的起始月份
|
|
|
+ .startOf("month")
|
|
|
+ .format("YYYY-MM-DD HH:mm:ss"),
|
|
|
+ end_time: dayjs()
|
|
|
+ .month(Math.floor(dayjs().month() / 3) * 3 + 2) // 当前季度的结束月份
|
|
|
+ .endOf("month")
|
|
|
+ .format("YYYY-MM-DD HH:mm:ss"),
|
|
|
},
|
|
|
{
|
|
|
name: '上季度',
|
|
|
- start_time: dayjs().add(-1, 'year').month(9).format('YYYY-MM-DD HH:mm:ss'),
|
|
|
- end_time: dayjs().add(-1, 'year').month(11).endOf('month').format('YYYY-MM-DD HH:mm:ss')
|
|
|
+ start_time: dayjs()
|
|
|
+ .month(Math.floor(dayjs().month() / 3) * 3 - 3) // 上季度的起始月份
|
|
|
+ .startOf('month')
|
|
|
+ .format('YYYY-MM-DD HH:mm:ss'),
|
|
|
+ end_time: dayjs()
|
|
|
+ .month(Math.floor(dayjs().month() / 3) * 3 - 1) // 上季度的结束月份
|
|
|
+ .endOf('month')
|
|
|
+ .format('YYYY-MM-DD HH:mm:ss')
|
|
|
}
|
|
|
];
|