UNPKG

camote-utils

Version:

A comprehensive TypeScript utility library featuring advanced string and number formatting, data structures, and algorithms

14 lines (13 loc) 479 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.isDateWithinRange = void 0; const isDateWithinRange = (startDate, endDate, date = new Date()) => { if (!startDate || !endDate || !date) return false; const start = new Date(startDate); const end = new Date(endDate); start.setHours(0, 0, 0, 0); end.setHours(23, 59, 59, 999); return date >= start && date <= end; }; exports.isDateWithinRange = isDateWithinRange;