"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("date-fns"),l=require("../utils/index.cjs");let r;function a(e,t){return o(),n.format(e,t,{locale:r})}function u(e,t){return o(),n.formatDuration(e,{locale:r,format:t})}function c(e,t){return o(),n.formatDistance(e,t,{locale:r})}function s(){return r!==void 0}function o(){if(!s())throw new Error("Locale not set, please call setDateLocale(locale) and pass in a datefns locale object as the locale param before calling this function")}function f(e){r=e}function M(e){return a(e,"MMMM d, y")}function m(e){if(e<60)return c(0,29*1e3);const t=n.intervalToDuration({start:0,end:e*1e3});return u(t,["hours","minutes"])}function i(e){const t=new Intl.RelativeTimeFormat(r.code,{numeric:"auto"});return l.capitalizeFirstLetter(t.formatToParts(e,"day")[0].value,r.code)}function d(e){return n.isToday(e)?i(0):n.isYesterday(e)?i(-1):n.isThisWeek(e)?a(e,"EEEE"):n.isThisYear(e)?a(e,"EEEE, MMMM d"):a(e,"MMMM d, y")}exports.durationInHHMM=m;exports.getDateMedium=M;exports.relativeDate=d;exports.setDateLocale=f;
//# sourceMappingURL=index.cjs.map
