|
@@ -17,14 +17,13 @@ const dateType = inject<Ref>('dateDimension');
|
|
|
|
|
|
const dateRange = ref([
|
|
|
dayjs().subtract(6, 'day').startOf('day').format('YYYY-MM-DD'),
|
|
|
- dayjs().endOf('day').format('YYYY-MM-DD')
|
|
|
+ dayjs().subtract(1, 'day').endOf('day').format('YYYY-MM-DD')
|
|
|
]);
|
|
|
|
|
|
const startWeek = ref(null);
|
|
|
const endWeek = ref(null);
|
|
|
-const weekStartDate = ref<string | null>(dayjs().locale('en').subtract(1, 'week').startOf('week').format('YYYY-MM-DD'));
|
|
|
-const weekEndDate = ref<string | null>(dayjs().locale('en').endOf('week').format('YYYY-MM-DD'));
|
|
|
-
|
|
|
+const weekStartDate = ref<string | null>(dayjs().locale('en').subtract(5, 'week').startOf('week').format('YYYY-MM-DD'));
|
|
|
+const weekEndDate = ref<string | null>(dayjs().locale('en').subtract(1, 'week').endOf('week').format('YYYY-MM-DD'));
|
|
|
const currentYear = new Date().getFullYear();
|
|
|
const currentMonth = new Date().getMonth();
|
|
|
const monthlyDataTime = ref([
|
|
@@ -134,12 +133,12 @@ const weekDisabledDate = (time: Date) => {
|
|
|
function setDefaultDate() {
|
|
|
dateRange.value = [
|
|
|
dayjs().subtract(6, 'day').startOf('day').format('YYYY-MM-DD'),
|
|
|
- dayjs().endOf('day').format('YYYY-MM-DD')
|
|
|
+ dayjs().subtract(1, 'day').endOf('day').format('YYYY-MM-DD')
|
|
|
];
|
|
|
- startWeek.value = dayjs().locale('en').subtract(1, 'week').startOf('week').format('YYYY-MM-DD');
|
|
|
- endWeek.value = dayjs().locale('en').endOf('week').format('YYYY-MM-DD');
|
|
|
- const startOfMonth = new Date(new Date().getFullYear(), new Date().getMonth() - 1, 1);
|
|
|
- const endOfMonth = new Date(new Date().getFullYear(), new Date().getMonth() + 1, 0); // 设置下个月的第一天减去1天,得到当前月的最后一天
|
|
|
+ startWeek.value = dayjs().locale('en').subtract(5, 'week').startOf('week').format('YYYY-MM-DD');
|
|
|
+ endWeek.value = dayjs().locale('en').subtract(1, 'week').endOf('week').format('YYYY-MM-DD');
|
|
|
+ const startOfMonth = new Date(new Date().getFullYear(), new Date().getMonth() - 5, 1);
|
|
|
+ const endOfMonth = new Date(new Date().getFullYear(), new Date().getMonth(), 0); // 设置下个月的第一天减去1天,得到当前月的最后一天
|
|
|
monthlyDataTime.value = [startOfMonth, endOfMonth];
|
|
|
const formattedStartDate = dayjs(startOfMonth).format('YYYY-MM-DD');
|
|
|
const formattedEndDate = dayjs(endOfMonth).format('YYYY-MM-DD');
|