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[]> {
|
||||
return this.restangular.one('account', id).getList('category', {
|
||||
begin: minDate,
|
||||
end: maxDate
|
||||
});
|
||||
var dateRange: any;
|
||||
if(minDate) {
|
||||
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