refs #6006 mod dias anteriores #1662

Merged
carlossa merged 2 commits from hotfix-travel into master 2023-07-13 04:04:19 +00:00
1 changed files with 4 additions and 2 deletions

View File

@ -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});