apply default filters
gitea/salix/master This commit looks good
Details
gitea/salix/master This commit looks good
Details
This commit is contained in:
parent
6b9286d1b0
commit
eefa4b9f5b
|
@ -18,6 +18,20 @@ export default class Controller {
|
|||
this.$.balanceCreateDialog.show();
|
||||
}, name: 'Payment on account...', always: true}
|
||||
];
|
||||
|
||||
if (!$stateParams.q)
|
||||
this.setDefaultFilter();
|
||||
}
|
||||
|
||||
setDefaultFilter() {
|
||||
const today = new Date();
|
||||
today.setHours(0, 0, 0, 0);
|
||||
|
||||
const tomorrow = new Date();
|
||||
tomorrow.setDate(tomorrow.getDate() + 1);
|
||||
tomorrow.setHours(23, 59, 59, 999);
|
||||
|
||||
this.filter = {from: today, to: tomorrow};
|
||||
}
|
||||
|
||||
setBalanceCreateDialog() {
|
||||
|
@ -55,17 +69,7 @@ export default class Controller {
|
|||
this.scopeDays = params.scopeDays;
|
||||
this.buildFilterDates();
|
||||
params = Object.assign(params, {from: this.today, to: this.daysOnward});
|
||||
} else if (!params.from && !params.to) {
|
||||
const today = new Date();
|
||||
today.setHours(0, 0, 0, 0);
|
||||
|
||||
const tomorrow = new Date();
|
||||
tomorrow.setDate(tomorrow.getDate() + 1);
|
||||
tomorrow.setHours(23, 59, 59, 999);
|
||||
|
||||
params = Object.assign(params, {from: today, to: tomorrow});
|
||||
}
|
||||
|
||||
this.$.model.applyFilter(null, params);
|
||||
} else
|
||||
this.$.model.clear();
|
||||
|
|
Loading…
Reference in New Issue