1 |
|
2 |
|
3 |
|
4 |
|
5 |
|
6 | export function isDateInterval(matcher) {
|
7 | return Boolean(matcher &&
|
8 | typeof matcher === "object" &&
|
9 | "before" in matcher &&
|
10 | "after" in matcher);
|
11 | }
|
12 |
|
13 |
|
14 |
|
15 |
|
16 |
|
17 | export function isDateRange(value) {
|
18 | return Boolean(value && typeof value === "object" && "from" in value);
|
19 | }
|
20 |
|
21 |
|
22 |
|
23 |
|
24 |
|
25 | export function isDateAfterType(value) {
|
26 | return Boolean(value && typeof value === "object" && "after" in value);
|
27 | }
|
28 |
|
29 |
|
30 |
|
31 |
|
32 |
|
33 | export function isDateBeforeType(value) {
|
34 | return Boolean(value && typeof value === "object" && "before" in value);
|
35 | }
|
36 |
|
37 |
|
38 |
|
39 |
|
40 |
|
41 | export function isDayOfWeekType(value) {
|
42 | return Boolean(value && typeof value === "object" && "dayOfWeek" in value);
|
43 | }
|
44 |
|
45 | export function isDatesArray(value, dateLib) {
|
46 | return Array.isArray(value) && value.every(dateLib.isDate);
|
47 | }
|
48 |
|
\ | No newline at end of file |