UNPKG

@daysnap/utils

Version:
20 lines (17 loc) 350 B
import { isString } from "./chunk-F4QMON2N.js"; // src/normalizeDate.ts function normalizeDate(value) { if (isString(value) && !value.endsWith("Z")) { value = value.replace(/-/g, "/"); const arr = value.split("/"); if (arr.length < 3) { value = `${value}/01`; } } return new Date(value); } export { normalizeDate };