This commit is contained in:
孟帅
2023-05-10 23:54:50 +08:00
parent bbe655a4d8
commit 49a96750bf
314 changed files with 15138 additions and 6244 deletions

View File

@@ -178,11 +178,15 @@ export function defShortcuts() {
export function defRangeShortcuts() {
const nowDate = new Date();
const dayBase = 86400 * 1000;
return {
: [startOfToday().getTime(), endOfToday().getTime()] as const,
: () => {
return [startOfYesterday().getTime(), endOfYesterday().getTime()] as const;
},
7: [startOfToday().getTime() - dayBase * 6, endOfToday().getTime()] as const,
30: [startOfToday().getTime() - dayBase * 29, endOfToday().getTime()] as const,
90: [startOfToday().getTime() - dayBase * 89, endOfToday().getTime()] as const,
: () => {
return [
startOfWeek(nowDate, { weekStartsOn: 1 }).getTime(),
@@ -192,7 +196,7 @@ export function defRangeShortcuts() {
: () => {
return [startOfMonth(nowDate).getTime(), endOfMonth(nowDate).getTime()] as const;
},
: () => {
: () => {
return [
startOfMonth(subMonths(nowDate, 1)).getTime(),
endOfMonth(subMonths(nowDate, 1)).getTime(),