diff --git a/db/dump/fixtures.sql b/db/dump/fixtures.sql index a6bb86dcd..ef2ed8045 100644 --- a/db/dump/fixtures.sql +++ b/db/dump/fixtures.sql @@ -934,10 +934,10 @@ INSERT INTO `vn`.`expedition`(`id`, `agencyModeFk`, `ticketFk`, `freightItemFk`, (7, 2, 4, 71, DATE_ADD(util.VN_CURDATE(), INTERVAL -3 MONTH), 1, 18, NULL, 94, NULL,NULL), (8, 3, 5, 71, DATE_ADD(util.VN_CURDATE(), INTERVAL -4 MONTH), 1, 18, NULL, 94, 1, NULL), (9, 3, 6, 71, DATE_ADD(util.VN_CURDATE(), INTERVAL -1 MONTH), 1, 18, NULL, 94, 2, NULL), - (10, 7, 7, 71, NOW(), 1, 18, NULL, 94, 3, NULL), - (11, 7, 8, 71, NOW(), 1, 18, NULL, 94, 3, NULL), - (12, 7, 9, 71, NOW(), 1, 18, NULL, 94, 3, NULL), - (13, 1, 10,71, NOW(), 1, 18, NULL, 94, 3, NULL); + (10, 7, 7, 71, util.VN_NOW(), 1, 18, NULL, 94, 3, NULL), + (11, 7, 8, 71, util.VN_NOW(), 1, 18, NULL, 94, 3, NULL), + (12, 7, 9, 71, util.VN_NOW(), 1, 18, NULL, 94, 3, NULL), + (13, 1, 10,71, util.VN_NOW(), 1, 18, NULL, 94, 3, NULL); INSERT INTO `vn`.`expeditionState`(`id`, `created`, `expeditionFk`, `typeFk`, `userFk`) diff --git a/e2e/paths/02-client/14_balance.spec.js b/e2e/paths/02-client/14_balance.spec.js index d3de842e3..7906fc021 100644 --- a/e2e/paths/02-client/14_balance.spec.js +++ b/e2e/paths/02-client/14_balance.spec.js @@ -1,7 +1,7 @@ import selectors from '../../helpers/selectors'; import getBrowser from '../../helpers/puppeteer'; -describe('Client balance path', () => { +fdescribe('Client balance path', () => { let browser; let page; beforeAll(async() => { diff --git a/front/core/services/date.js b/front/core/services/date.js index 0d013b9f6..977d77430 100644 --- a/front/core/services/date.js +++ b/front/core/services/date.js @@ -1,3 +1,11 @@ +Date.vnUTC = () => { + const env = process.env.NODE_ENV; + if (!env || env === 'development') + return new Date(Date.UTC(2022, 5, 15, 11)); + + return new Date(Date.UTC()); +}; + Date.vnNew = () => { return new Date(Date.vnUTC()); }; @@ -6,10 +14,3 @@ Date.vnNow = () => { return new Date(Date.vnUTC()).getTime(); }; -Date.vnUTC = () => { - const env = process.env.NODE_ENV; - if (!env || env === 'development') - return new Date(Date.UTC(2022, 5, 15, 11)); - - return new Date(Date.UTC()); -}; diff --git a/front/salix/services/index.js b/front/salix/services/index.js index 0fe541d1f..6d510638f 100644 --- a/front/salix/services/index.js +++ b/front/salix/services/index.js @@ -1,11 +1,3 @@ -Date.vnNew = () => { - return new Date(Date.vnUTC()); -}; - -Date.vnNow = () => { - return new Date(Date.vnUTC()).getTime(); -}; - Date.vnUTC = () => { const env = process.env.NODE_ENV; if (!env || env === 'development') @@ -13,3 +5,11 @@ Date.vnUTC = () => { return new Date(Date.UTC()); }; + +Date.vnNew = () => { + return new Date(Date.vnUTC()); +}; + +Date.vnNow = () => { + return new Date(Date.vnUTC()).getTime(); +}; diff --git a/jest-front.js b/jest-front.js index 45fed2319..0a2db5ec1 100644 --- a/jest-front.js +++ b/jest-front.js @@ -36,16 +36,17 @@ window.ngModule = function(moduleName, ...args) { if (args.length) fns = fns.concat(args); + Date.vnUTC = () => { - return new Date(Date.UTC(2000, 0, 1, 11)); + return new Date(Date.UTC(2022, 5, 15, 11)); }; Date.vnNew = () => { - return new Date(Date.UTC(2000, 0, 1, 11)); + return new Date(Date.UTC(2022, 5, 15, 11)); }; Date.vnNow = () => { - return new Date(Date.UTC(2000, 0, 1, 11)).getTime(); + return new Date(Date.UTC(2022, 5, 15, 11)).getTime(); }; return angular.mock.module(...fns); }; diff --git a/loopback/server/boot/date.js b/loopback/server/boot/date.js index 73eebf3be..27fbbd589 100644 --- a/loopback/server/boot/date.js +++ b/loopback/server/boot/date.js @@ -1,12 +1,4 @@ module.exports = () => { - Date.vnNew = () => { - return new Date(Date.vnUTC()); - }; - - Date.vnNow = () => { - return new Date(Date.vnUTC()).getTime(); - }; - Date.vnUTC = () => { const env = process.env.NODE_ENV; if (!env || env === 'development') @@ -14,4 +6,12 @@ module.exports = () => { return new Date(Date.UTC()); }; + + Date.vnNew = () => { + return new Date(Date.vnUTC()); + }; + + Date.vnNow = () => { + return new Date(Date.vnUTC()).getTime(); + }; };