diff --git a/config/webpack.config.js b/config/webpack.config.js index 1e6a278f..cd2055cd 100644 --- a/config/webpack.config.js +++ b/config/webpack.config.js @@ -21,12 +21,6 @@ module.exports = { arrowFunction: false, }, }, - plugins: [ - new webpack.IgnorePlugin({ - resourceRegExp: /^\.\/locale$/, - contextRegExp: /moment$/, - }), - ], resolve: { extensions: ['.ts', '.js'], plugins: [ diff --git a/package.json b/package.json index f41df024..6ac91e81 100644 --- a/package.json +++ b/package.json @@ -112,8 +112,7 @@ "fetch-ponyfill": "^7.1.0", "inputmask": "5.0.9", "json-logic-js": "^2.0.5", - "lodash": "^4.17.21", - "moment": "^2.29.4" + "lodash": "^4.17.21" }, "nyc": { "check-coverage": true, diff --git a/src/utils/operators/DateGreaterThan.js b/src/utils/operators/DateGreaterThan.js index 7c00cd9b..0d5224b2 100644 --- a/src/utils/operators/DateGreaterThan.js +++ b/src/utils/operators/DateGreaterThan.js @@ -1,6 +1,15 @@ import ConditionOperator from './ConditionOperator'; -import moment from 'moment'; +import dayjs from 'dayjs'; +import utc from 'dayjs/plugin/utc'; +import timezone from 'dayjs/plugin/timezone'; +import customParseFormat from 'dayjs/plugin/customParseFormat'; +import advancedFormat from 'dayjs/plugin/advancedFormat'; import { isPartialDay, getDateValidationFormat } from '../../utils/date'; + +dayjs.extend(utc); +dayjs.extend(timezone); +dayjs.extend(customParseFormat); +dayjs.extend(advancedFormat); export default class DateGeaterThan extends ConditionOperator { static get operatorKey() { return 'dateGreaterThan'; @@ -15,10 +24,10 @@ export default class DateGeaterThan extends ConditionOperator { conditionTriggerComponent && conditionTriggerComponent.component.type === 'day' ? getDateValidationFormat(conditionTriggerComponent.component) : null; - const date = validationFormat ? moment(value, validationFormat) : moment(value); + const date = validationFormat ? dayjs(value, validationFormat) : dayjs(value); const comparedDate = validationFormat - ? moment(comparedValue, validationFormat) - : moment(comparedValue); + ? dayjs(comparedValue, validationFormat) + : dayjs(comparedValue); return { date, comparedDate }; } diff --git a/yarn.lock b/yarn.lock index 627acd22..20db5882 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3735,11 +3735,6 @@ mock-local-storage@^1.1.20: core-js "^3.30.2" global "^4.3.2" -moment@^2.29.4: - version "2.30.1" - resolved "https://registry.npmjs.org/moment/-/moment-2.30.1.tgz#f8c91c07b7a786e30c59926df530b4eac96974ae" - integrity sha512-uEmtNhbDOrWPFS+hdjFCBfy9f2YoyzRpwcl+DqpC6taX21FzsTLQVbMV/W7PzNSX6x/bhC1zA3c2UQ5NzH6how== - ms@2.1.2: version "2.1.2" resolved "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz"