PageSourceSearch

https://kuto.app/static/DateRange-CJZLnxOb.js

js kuto.app collected 2026-10-07 04:06:26 UTC 2,370 bytes, 96 lines download raw bytes

1import { h as dayjs } from "./index-B4tqMR8N.js";
2function dateRange(start, end) {
3  if (start == null) {
4    return {
5      start: dayjs().startOf("day").valueOf(),
6      end: dayjs().endOf("day").valueOf()
7    };
8  } else if (end == null) {
9    return {
10      start: dayjs(start).startOf("day").valueOf(),
11      end: dayjs(start).endOf("day").valueOf()
12    };
13  } else {
14    return { start, end };
15  }
16}
17function isDateInRange(date, range) {
18  return date >= range.start && date <= range.end;
19}
20function areDateRangesEqual(range1, range2) {
21  if (range1 == null && range2 == null) {
22    return true;
23  } else if (range1 == null || range2 == null) {
24    return false;
25  } else {
26    return range1.start === range2.start && range1.end === range2.end;
27  }
28}
29function isSameDay(range) {
30  return dayjs(range.start).isSame(dayjs(range.end), "day");
31}
32const AllDateRangePresets = [
33  {
34    title: "Today",
35    range: () => ({
36      start: dayjs().startOf("day").valueOf(),
37      end: dayjs().endOf("day").valueOf()
38    })
39  },
40  {
41    title: "Yesterday",
42    range: () => ({
43      start: dayjs().subtract(1, "day").startOf("day").valueOf(),
44      end: dayjs().subtract(1, "day").endOf("day").valueOf()
45    })
46  },
47  {
48    title: "This Week",
49    range: () => ({
50      start: dayjs().startOf("week").valueOf(),
51      end: dayjs().endOf("week").valueOf()
52    })
53  },
54  {
55    title: "Last Week",
56    range: () => ({
57      start: dayjs().subtract(1, "week").startOf("week").valueOf(),
58      end: dayjs().subtract(1, "week").endOf("week").valueOf()
59    })
60  },
61  {
62    title: "This Month",
63    range: () => ({
64      start: dayjs().startOf("month").valueOf(),
65      end: dayjs().endOf("month").valueOf()
66    })
67  },
68  {
69    title: "Last Month",
70    range: () => ({
71      start: dayjs().subtract(1, "month").startOf("month").valueOf(),
72      end: dayjs().subtract(1, "month").endOf("month").valueOf()
73    })
74  },
75  {
76    title: "This Year",
77    range: () => ({
78      start: dayjs().startOf("year").valueOf(),
79      end: dayjs().endOf("year").valueOf()
80    })
81  },
82  {
83    title: "Last Year",
84    range: () => ({
85      start: dayjs().subtract(1, "year").startOf("year").valueOf(),
86      end: dayjs().subtract(1, "year").endOf("year").valueOf()
87    })
88  }
89];
90export {
91  AllDateRangePresets as A,
92  isDateInRange as a,
93  areDateRangesEqual as b,
94  dateRange as d,
95  isSameDay as i
96};

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.