10 lines
393 B
Plaintext
10 lines
393 B
Plaintext
import isAfter from "./isAfter.mjs";
|
|
import isBefore from "./isBefore.mjs";
|
|
function isBetween(date, from, to, unit, inclusivity) {
|
|
inclusivity = inclusivity || "()";
|
|
return (inclusivity.startsWith("(") ? isAfter(date, from, unit) : !isBefore(date, from, unit)) && (inclusivity.charAt(1) === ")" ? isBefore(date, to, unit) : !isAfter(date, to, unit));
|
|
}
|
|
export {
|
|
isBetween as default
|
|
};
|