diff --git a/src/app/app.component.html b/src/app/app.component.html
index 4d6a2ed..1ca7739 100644
--- a/src/app/app.component.html
+++ b/src/app/app.component.html
@@ -22,7 +22,7 @@
-
+
diff --git a/src/app/app.component.ts b/src/app/app.component.ts
index 117830c..3d3f09d 100644
--- a/src/app/app.component.ts
+++ b/src/app/app.component.ts
@@ -5,6 +5,7 @@ import { ChartComponent } from './chart/chart.component';
import { RestService } from './rest.service';
import { NgbModule } from '@ng-bootstrap/ng-bootstrap';
import { NgbDropdownModule } from '@ng-bootstrap/ng-bootstrap';
+import { endOfMonth, format, startOfMonth, subMonths } from 'date-fns';
@Component({
selector: 'app-root',
@@ -48,7 +49,23 @@ export class AppComponent implements OnInit, OnChanges {
return 'Unbekannt';
}
}
+
+ testFunction(): string {
+ let startThisMonth: Date = subMonths(startOfMonth(new Date()), 1);
+ let returnValue: string = '';
+ for (let i = 0; i < 12; i++) {
+ let endThisMonth: Date = endOfMonth(startThisMonth);
+ returnValue += ' / ' + format(startThisMonth, 'dd.MM.yyyy HH:mm:ss')
+ + ' - ' + format(endThisMonth, 'dd.MM.yyyy HH:mm:ss')
+ + ' (' + startThisMonth.getTime() + ' - ' + endThisMonth.getTime() + ')
';
+ startThisMonth = subMonths(startThisMonth, 1);
+ }
+ return returnValue;
+ }
houseId: number | undefined = undefined;
duration: number | undefined = undefined;
+
+ startThisMonth: Date = startOfMonth(new Date());
+ testDate: string = '';
}