Merge pull request 'refs #6006 mod dias anteriores' (!1662) from hotfix-travel into master
gitea/salix/pipeline/head This commit looks good
Details
gitea/salix/pipeline/head This commit looks good
Details
Reviewed-on: #1662 Reviewed-by: Javi Gallego <jgallego@verdnatura.es> Reviewed-by: Alex Moreno <alexm@verdnatura.es>
This commit is contained in:
commit
b228b693cc
|
@ -38,10 +38,12 @@ class Controller extends SearchPanel {
|
||||||
|
|
||||||
applyFilters(param) {
|
applyFilters(param) {
|
||||||
if (typeof this.filter.scopeDays === 'number') {
|
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);
|
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.setDate(shippedTo.getDate() + this.filter.scopeDays);
|
||||||
shippedTo.setHours(23, 59, 59, 999);
|
shippedTo.setHours(23, 59, 59, 999);
|
||||||
Object.assign(this.filter, {shippedFrom, shippedTo});
|
Object.assign(this.filter, {shippedFrom, shippedTo});
|
||||||
|
|
Loading…
Reference in New Issue