From 510b78c7035eabcef9d51c78816fe3349968f9c5 Mon Sep 17 00:00:00 2001 From: carlossa Date: Wed, 12 Jul 2023 13:08:46 +0200 Subject: [PATCH] refs #6006 mod dias anteriores --- modules/travel/front/search-panel/index.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/modules/travel/front/search-panel/index.js b/modules/travel/front/search-panel/index.js index 089953127..f53c15ca8 100644 --- a/modules/travel/front/search-panel/index.js +++ b/modules/travel/front/search-panel/index.js @@ -38,10 +38,12 @@ class Controller extends SearchPanel { applyFilters(param) { if (typeof this.filter.scopeDays === 'number') { - const shippedFrom = Date.vnNew(); + const today = Date.vnNew(); + const shippedFrom = new Date(today.getTime()); + shippedFrom.setDate(today.getDate() - 30); shippedFrom.setHours(0, 0, 0, 0); - const shippedTo = new Date(shippedFrom.getTime()); + const shippedTo = new Date(today.getTime()); shippedTo.setDate(shippedTo.getDate() + this.filter.scopeDays); shippedTo.setHours(23, 59, 59, 999); Object.assign(this.filter, {shippedFrom, shippedTo});