UNPKG

@daysnap/utils

Version:
24 lines (21 loc) 463 B
import { formatDate } from "./chunk-UMJU7UF2.js"; import { normalizeDate } from "./chunk-A3YS6665.js"; // src/getRangeDate.ts function getRangeDate(sv, ev, fmt) { const result = []; const start = normalizeDate(sv); const end = normalizeDate(ev); const current = start; while (current <= end) { result.push(fmt ? formatDate(current, fmt) : current); current.setDate(current.getDate() + 1); } return result; } export { getRangeDate };