bjuppa / com-plain-date

JavaScript date-time utilities that keep timezones on the surface
https://deno.land/x/complaindate/mod.ts
MIT License
1 stars 0 forks source link

Create utility for checking if JS Date is in a period #78

Open bjuppa opened 1 year ago

bjuppa commented 1 year ago

isInPeriod(start: Date)(end: Date)(instant: Date): boolean

Sort start & end, apply closed start & open ending.

bjuppa commented 10 months ago

If we apply closed start and open ending to the period, shouldn't we honor that for a "reverse" period too (when start is after end)? 🤔