"use strict";
Object.defineProperty(exports, "__esModule", {
    value: true
});
Object.defineProperty(exports, "getStoredNoteDateFormatters", {
    enumerable: true,
    get: function() {
        return getStoredNoteDateFormatters;
    }
});
const _config = /*#__PURE__*/ _interop_require_default(require("config"));
const _dateFormatters = require("@tamanu/utils/dateFormatters");
const _timeZoneCheck = require("@tamanu/shared/utils/timeZoneCheck");
function _interop_require_default(obj) {
    return obj && obj.__esModule ? obj : {
        default: obj
    };
}
function getStoredNoteDateFormatters(SettingModel) {
    let localePromise;
    const locale = ()=>localePromise ?? (localePromise = SettingModel.get('dateTimeLocale').then((value)=>value));
    const primaryTimeZone = (0, _timeZoneCheck.getPrimaryTimeZone)(_config.default);
    return {
        formatShort: async (date)=>(0, _dateFormatters.formatShort)(date, primaryTimeZone, null, await locale()),
        formatShortDateTime: async (date)=>(0, _dateFormatters.formatShortDateTime)(date, primaryTimeZone, null, await locale())
    };
}

//# sourceMappingURL=storedNoteDateFormatters.js.map