This commit is contained in:
Emily
2024-06-21 17:50:51 +02:00
parent d8445b3f1a
commit 240a9cd633
3 changed files with 39 additions and 2 deletions

View File

@@ -1,10 +1,32 @@
import dayjs from 'dayjs';
export type Slice = 'day' | 'hour' | 'month' | 'year';
export type Slice = keyof typeof slicesData;
const slicesData = {
hour: {
fromOffset: 1000 * 60 * 60 * 24
},
day: {
fromOffset: 1000 * 60 * 60 * 24 * 7
},
month: {
fromOffset: 1000 * 60 * 60 * 24 * 30 * 12
},
year: {
fromOffset: 1000 * 60 * 60 * 24 * 30 * 12 * 10
}
}
class DateService {
public slicesData = slicesData;
getDefaultRange(slice: Slice, from?: string, to?: string) {
}
getQueryDateRange(slice: Slice) {
const group: Record<string, any> = {}