import { capitalizeFirstLetter as e } from "../utils/index.js";
import { format as t, formatDistance as n, formatDuration as r, intervalToDuration as i, isThisWeek as a, isThisYear as o, isToday as s, isYesterday as c } from "date-fns";
//#region common/dates/index.js
var l;
function u(e, n) {
	return m(), t(e, n, { locale: l });
}
function d(e, t) {
	return m(), r(e, {
		locale: l,
		format: t
	});
}
function f(e, t) {
	return m(), n(e, t, { locale: l });
}
function p() {
	return l !== void 0;
}
function m() {
	if (!p()) throw Error("Locale not set, please call setDateLocale(locale) and pass in a datefns locale object as the locale param before calling this function");
}
function h(e) {
	l = e;
}
function g(e) {
	return u(e, "MMMM d, y");
}
function _(e) {
	return e < 60 ? f(0, 29 * 1e3) : d(i({
		start: 0,
		end: e * 1e3
	}), ["hours", "minutes"]);
}
function v(t) {
	return e(new Intl.RelativeTimeFormat(l.code, { numeric: "auto" }).formatToParts(t, "day")[0].value, l.code);
}
function y(e) {
	return s(e) ? v(0) : c(e) ? v(-1) : a(e) ? u(e, "EEEE") : o(e) ? u(e, "EEEE, MMMM d") : u(e, "MMMM d, y");
}
//#endregion
export { _ as durationInHHMM, g as getDateMedium, y as relativeDate, h as setDateLocale };

//# sourceMappingURL=index.js.map