|
| 1 | +import { Interval } from "luxon"; |
| 2 | + |
| 3 | +export const WITH_OVERLAPPING_INTERVALS = { |
| 4 | + "pair of overlapping intervals": [ |
| 5 | + Interval.fromISO("2025-03-01/2025-03-04", { zone: "utc" }), |
| 6 | + Interval.fromISO("2025-03-02/2025-03-05", { zone: "utc" }), |
| 7 | + ], |
| 8 | + |
| 9 | + "group of equal intervals": [ |
| 10 | + Interval.fromISO("2025-03-01/2025-03-07", { zone: "utc" }), |
| 11 | + Interval.fromISO("2025-03-01/2025-03-07", { zone: "utc" }), |
| 12 | + Interval.fromISO("2025-03-01/2025-03-07", { zone: "utc" }), |
| 13 | + Interval.fromISO("2025-03-01/2025-03-07", { zone: "utc" }), |
| 14 | + Interval.fromISO("2025-03-01/2025-03-07", { zone: "utc" }), |
| 15 | + ], |
| 16 | + |
| 17 | + "group of overlapping intervals with the same start time": [ |
| 18 | + Interval.fromISO("2025-03-01/2025-03-04", { zone: "utc" }), |
| 19 | + Interval.fromISO("2025-03-01/2025-03-05", { zone: "utc" }), |
| 20 | + Interval.fromISO("2025-03-01/2025-03-06", { zone: "utc" }), |
| 21 | + ], |
| 22 | + |
| 23 | + "group of overlapping intervals with the same end time": [ |
| 24 | + Interval.fromISO("2025-03-01/2025-03-06", { zone: "utc" }), |
| 25 | + Interval.fromISO("2025-03-02/2025-03-06", { zone: "utc" }), |
| 26 | + Interval.fromISO("2025-03-03/2025-03-06", { zone: "utc" }), |
| 27 | + ], |
| 28 | + |
| 29 | + "group of overlapping intervals with non-overlapping intervals in between": [ |
| 30 | + Interval.fromISO("2025-03-01/2025-03-04", { zone: "utc" }), |
| 31 | + Interval.fromISO("2025-03-02/2025-03-05", { zone: "utc" }), |
| 32 | + Interval.fromISO("2025-03-13/2025-03-16", { zone: "utc" }), |
| 33 | + Interval.fromISO("2025-03-21/2025-03-24", { zone: "utc" }), |
| 34 | + Interval.fromISO("2025-03-22/2025-03-25", { zone: "utc" }), |
| 35 | + Interval.fromISO("2025-04-02/2025-04-05", { zone: "utc" }), |
| 36 | + Interval.fromISO("2025-04-13/2025-04-16", { zone: "utc" }), |
| 37 | + Interval.fromISO("2025-04-14/2025-04-17", { zone: "utc" }), |
| 38 | + ], |
| 39 | + |
| 40 | + "group of one interval before an overlapping group": [ |
| 41 | + Interval.fromISO("2025-03-01/2025-03-03", { zone: "utc" }), |
| 42 | + Interval.fromISO("2025-03-05/2025-03-08", { zone: "utc" }), |
| 43 | + Interval.fromISO("2025-03-06/2025-03-09", { zone: "utc" }), |
| 44 | + Interval.fromISO("2025-03-07/2025-03-10", { zone: "utc" }), |
| 45 | + ], |
| 46 | + |
| 47 | + "group of one interval after an overlapping group": [ |
| 48 | + Interval.fromISO("2025-03-05/2025-03-08", { zone: "utc" }), |
| 49 | + Interval.fromISO("2025-03-06/2025-03-09", { zone: "utc" }), |
| 50 | + Interval.fromISO("2025-03-07/2025-03-10", { zone: "utc" }), |
| 51 | + Interval.fromISO("2025-03-11/2025-03-13", { zone: "utc" }), |
| 52 | + ], |
| 53 | +} as Record<string, Interval<true>[]>; |
| 54 | + |
| 55 | +export const WITHOUT_OVERLAPPING_INTERVALS = { |
| 56 | + "empty group of intervals": [], |
| 57 | + "group of one interval": [Interval.fromISO("2025-03-01/2025-03-04", { zone: "utc" })], |
| 58 | + |
| 59 | + "pair of non-overlapping intervals": [ |
| 60 | + Interval.fromISO("2025-03-01/2025-03-04", { zone: "utc" }), |
| 61 | + Interval.fromISO("2025-03-14/2025-03-15", { zone: "utc" }), |
| 62 | + ], |
| 63 | + |
| 64 | + "group of adjacent intervals": [ |
| 65 | + Interval.fromISO("2025-03-01/2025-03-02", { zone: "utc" }), |
| 66 | + Interval.fromISO("2025-03-02/2025-03-03", { zone: "utc" }), |
| 67 | + Interval.fromISO("2025-03-03/2025-03-04", { zone: "utc" }), |
| 68 | + Interval.fromISO("2025-03-04/2025-03-05", { zone: "utc" }), |
| 69 | + Interval.fromISO("2025-03-05/2025-03-06", { zone: "utc" }), |
| 70 | + ], |
| 71 | + |
| 72 | + "group of non-overlapping intervals": [ |
| 73 | + Interval.fromISO("2025-03-01/2025-03-03", { zone: "utc" }), |
| 74 | + Interval.fromISO("2025-03-05/2025-03-07", { zone: "utc" }), |
| 75 | + Interval.fromISO("2025-03-09/2025-03-11", { zone: "utc" }), |
| 76 | + Interval.fromISO("2025-03-13/2025-03-15", { zone: "utc" }), |
| 77 | + ], |
| 78 | +} as Record<string, Interval<true>[]>; |
0 commit comments