diff --git a/src/utils/utils.js b/src/utils/utils.js index 6bfb05a5af..7c3395cdf9 100644 --- a/src/utils/utils.js +++ b/src/utils/utils.js @@ -1,6 +1,5 @@ /* global jQuery */ import _ from 'lodash'; -import moment from 'moment-timezone/moment-timezone'; import jtz from 'jstimezonedetect'; import dompurify from 'dompurify'; import dayjs from "dayjs"; @@ -563,14 +562,14 @@ export function getDateSetting(date) { return date.isValid() ? date.toDate() : null; } - let dateSetting = ((typeof date !== 'string') || (date.indexOf('moment(') === -1)) ? moment(date) : null; + let dateSetting = ((typeof date !== 'string') || (date.indexOf('dayjs(') === -1)) ? dayjs(date) : null; if (dateSetting && dateSetting.isValid()) { return dateSetting.toDate(); } dateSetting = null; try { - const value = Evaluator.evaluator(`return ${date};`, 'moment')(moment); + const value = Evaluator.evaluator(`return ${date};`, 'dayjs')(dayjs); if (typeof value === 'string') { dateSetting = dayjs(value); } @@ -638,6 +637,15 @@ export function offsetDate(date, timezone) { }; } +/** + * Returns if the zones are loaded. + * (This is legacy. The only reason why we need to keep this is to not break customers who may be using zonesLoaded) + * @returns {boolean} - TRUE if the zones are loaded; FALSE otherwise. + */ +export function zonesLoaded() { + return true +} + /** * Returns if we should handle a timezone difference. * @param {string} timezone - The timezone to check if we should load the zones.