@daysnap/utils
Version:
19 lines (16 loc) • 447 B
JavaScript
import {
formatDate
} from "./chunk-UMJU7UF2.js";
import {
normalizeDate
} from "./chunk-A3YS6665.js";
// src/getMonthBounds.ts
function getMonthBounds(value, fmt) {
const now = normalizeDate(value);
const start = new Date(now.getFullYear(), now.getMonth(), 1);
const end = new Date(now.getFullYear(), now.getMonth() + 1, 0);
return fmt ? [formatDate(start, fmt), formatDate(end, fmt)] : [start, end];
}
export {
getMonthBounds
};