Last active
October 14, 2024 14:16
-
-
Save mbbx6spp/aa6bde911b889e8ef5672a89c130d227 to your computer and use it in GitHub Desktop.
Revisions
-
mbbx6spp revised this gist
Oct 14, 2024 . No changes.There are no files selected for viewing
-
mbbx6spp revised this gist
Oct 14, 2024 . 1 changed file with 35 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,35 @@ ┌───────┬───────┬───────────────┐ │ (idx) │ value │ Values │ ├───────┼───────┼───────────────┤ │ 0 │ │ "2024-10-14~" │ │ 1 │ │ 1728864000000 │ │ 2 │ │ 1728950399999 │ │ 3 │ 255 │ │ │ 4 │ 0 │ │ │ 5 │ │ true │ │ 6 │ │ true │ │ 7 │ │ false │ └───────┴───────┴───────────────┘ ┌───────┬───────┬───────────────┐ │ (idx) │ value │ Values │ ├───────┼───────┼───────────────┤ │ 0 │ │ "2024-10-14?" │ │ 1 │ │ 1728864000000 │ │ 2 │ │ 1728950399999 │ │ 3 │ 0 │ │ │ 4 │ 255 │ │ │ 5 │ │ true │ │ 6 │ │ true │ │ 7 │ │ false │ └───────┴───────┴───────────────┘ ┌───────┬─────────────────────────┐ │ (idx) │ Values │ ├───────┼─────────────────────────┤ │ 0 │ "2024-10-11/2024-10-16" │ │ 1 │ 1728604800000 │ │ 2 │ 1729123199999 │ │ 3 │ undefined │ │ 4 │ undefined │ │ 5 │ true │ │ 6 │ true │ └───────┴─────────────────────────┘ -
mbbx6spp created this gist
Oct 14, 2024 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,37 @@ import edtf, { Date, Interval } from 'npm:edtf@4.6.0'; const approxStartDate = edtf('2024-10-14~'); const uncertainDate = edtf('2024-10-14?'); const interval = edtf('2024-10-11/2024-10-16'); console.table([ approxStartDate.edtf, approxStartDate.min, approxStartDate.max, approxStartDate.approximate, approxStartDate.uncertain, approxStartDate.covers(approxStartDate), approxStartDate.covers(uncertainDate), approxStartDate.covers(approxStartDate.next()), ]) console.table([ uncertainDate.edtf, uncertainDate.min, uncertainDate.max, uncertainDate.approximate, uncertainDate.uncertain, uncertainDate.covers(uncertainDate), uncertainDate.covers(approxStartDate), uncertainDate.covers(uncertainDate.next()), ]) console.table([ interval.edtf, interval.min, interval.max, interval.approximate, interval.uncertain, interval.covers(uncertainDate), interval.covers(approxStartDate), ])