FIX
This commit is contained in:
@@ -8,7 +8,6 @@ import { DecimalPipe } from '@angular/common';
|
||||
import { UntypedFormBuilder } from '@angular/forms';
|
||||
import { UntypedFormGroup } from '@angular/forms';
|
||||
import { Validators } from '@angular/forms';
|
||||
import { Inject } from '@angular/core';
|
||||
|
||||
// libs
|
||||
import {
|
||||
@@ -21,7 +20,6 @@ import {
|
||||
ApexLegend
|
||||
} from "ng-apexcharts";
|
||||
import * as moment from 'moment'
|
||||
import { MAT_DATE_FORMATS } from '@angular/material/core';
|
||||
|
||||
// app
|
||||
import { ApiRoutes } from '../../api-routes';
|
||||
@@ -61,27 +59,20 @@ export class DashboardOutcomeComponent implements OnInit {
|
||||
|
||||
ngOnInit() {
|
||||
this.form = this.fb.group({
|
||||
dateFrom: [
|
||||
this.dateFrom,
|
||||
[Validators.required],
|
||||
],
|
||||
dateTo: [
|
||||
this.dateTo,
|
||||
[Validators.required],
|
||||
],
|
||||
});
|
||||
|
||||
this.loadData();
|
||||
}
|
||||
|
||||
onSubmitClick() {
|
||||
|
||||
onChangePeriod(dates: Date[]) {
|
||||
this.dateFrom = dates[0];
|
||||
this.dateTo = dates[1];
|
||||
this.loadData();
|
||||
}
|
||||
|
||||
private loadData(update?: boolean, category?: string) {
|
||||
let params = new HttpParams()
|
||||
.set('from', '2023-07-01')
|
||||
.set('to', '2023-08-01')
|
||||
.set('from', moment(this.dateFrom).format('YYYY-MM-DD'))
|
||||
.set('to', moment(this.dateTo).format('YYYY-MM-DD'))
|
||||
.set('category', category || '')
|
||||
;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user