package.utils.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.
import dayjs from "dayjs";
// const hasTimezone = dateString => {
// const timezoneRegex = /Z|[+-]\d{2}:\d{2}$|GMT([+-]\d{4})?$/;
// return timezoneRegex.test(dateString);
// };
// const dayjs = (...args) => {
// if (args.length > 0 && typeof args[0] === "string" && hasTimezone(args[0])) {
// args[0] = pureDayjs(args[0]);
// }
// const timezone = pureDayjs.tz().$x.$timezone || pureDayjs.tz.guess();
// return args.length === 2
// ? pureDayjs.tz(...args, timezone)
// : pureDayjs.tz(...args);
// };
// Object.assign(dayjs, { ...pureDayjs });
export default dayjs;
//# sourceMappingURL=dayjs.js.map