package.cjs.initializers.dayjs.js Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of neeto-commons-frontend Show documentation
Show all versions of neeto-commons-frontend Show documentation
A package encapsulating common code across neeto projects including initializers, utility functions, common components and hooks and so on.
"use strict";
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
Object.defineProperty(exports, "__esModule", {
value: true
});
exports["default"] = void 0;
var _dayjs = _interopRequireDefault(require("dayjs"));
var _advancedFormat = _interopRequireDefault(require("dayjs/plugin/advancedFormat"));
var _customParseFormat = _interopRequireDefault(require("dayjs/plugin/customParseFormat"));
var _duration = _interopRequireDefault(require("dayjs/plugin/duration"));
var _isSameOrAfter = _interopRequireDefault(require("dayjs/plugin/isSameOrAfter"));
var _isSameOrBefore = _interopRequireDefault(require("dayjs/plugin/isSameOrBefore"));
var _isToday = _interopRequireDefault(require("dayjs/plugin/isToday"));
var _localeData = _interopRequireDefault(require("dayjs/plugin/localeData"));
var _localizedFormat = _interopRequireDefault(require("dayjs/plugin/localizedFormat"));
var _minMax = _interopRequireDefault(require("dayjs/plugin/minMax"));
var _quarterOfYear = _interopRequireDefault(require("dayjs/plugin/quarterOfYear"));
var _relativeTime = _interopRequireDefault(require("dayjs/plugin/relativeTime"));
var _timezone = _interopRequireDefault(require("dayjs/plugin/timezone"));
var _updateLocale = _interopRequireDefault(require("dayjs/plugin/updateLocale"));
var _utc = _interopRequireDefault(require("dayjs/plugin/utc"));
var _weekday = _interopRequireDefault(require("dayjs/plugin/weekday"));
var _weekOfYear = _interopRequireDefault(require("dayjs/plugin/weekOfYear"));
// const isValidTimezone = timezone => {
// try {
// pureDayjs().tz(timezone);
// return true;
// } catch {
// return false;
// }
// };
// eslint-disable-next-line no-unused-vars
var initializeDayjs = function initializeDayjs() {
var skipTimezone = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
_dayjs["default"].extend(_advancedFormat["default"]);
_dayjs["default"].extend(_customParseFormat["default"]);
_dayjs["default"].extend(_duration["default"]);
_dayjs["default"].extend(_isSameOrAfter["default"]);
_dayjs["default"].extend(_isSameOrBefore["default"]);
_dayjs["default"].extend(_isToday["default"]);
_dayjs["default"].extend(_localeData["default"]);
_dayjs["default"].extend(_localizedFormat["default"]);
_dayjs["default"].extend(_minMax["default"]);
_dayjs["default"].extend(_quarterOfYear["default"]);
_dayjs["default"].extend(_relativeTime["default"]);
_dayjs["default"].extend(_timezone["default"]);
_dayjs["default"].extend(_updateLocale["default"]);
_dayjs["default"].extend(_utc["default"]);
_dayjs["default"].extend(_weekday["default"]);
_dayjs["default"].extend(_weekOfYear["default"]);
// const shouldInitializeTimezone =
// !skipTimezone &&
// globalProps?.user?.timeZone &&
// isValidTimezone(globalProps?.user?.timeZone);
// if (shouldInitializeTimezone) {
// pureDayjs.tz.setDefault(globalProps?.user?.timeZone);
// }
};
var _default = initializeDayjs;
exports["default"] = _default;
//# sourceMappingURL=dayjs.js.map