Fix date range in category service.
This commit is contained in:
parent
927459b6c5
commit
89fc42c47a
@ -14,9 +14,15 @@ export class CategoryService {
|
|||||||
) {}
|
) {}
|
||||||
|
|
||||||
query(id: number, minDate: Date = null, maxDate: Date = null): Observable<Category[]> {
|
query(id: number, minDate: Date = null, maxDate: Date = null): Observable<Category[]> {
|
||||||
return this.restangular.one('account', id).getList('category', {
|
var dateRange: any;
|
||||||
begin: minDate,
|
if(minDate) {
|
||||||
end: maxDate
|
dateRange.begin = minDate;
|
||||||
});
|
}
|
||||||
|
|
||||||
|
if(maxDate) {
|
||||||
|
dateRange.end = maxDate;
|
||||||
|
}
|
||||||
|
|
||||||
|
return this.restangular.one('account', id).getList('category', dateRange);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user