diff --git a/src/main/angular/src/app/location/detail/location-detail.html b/src/main/angular/src/app/location/detail/location-detail.html index 3184c3b..3732e2d 100644 --- a/src/main/angular/src/app/location/detail/location-detail.html +++ b/src/main/angular/src/app/location/detail/location-detail.html @@ -2,21 +2,32 @@ - - - +
  -
+
  -
+
 
{{ offsetDayTitle() }}
+ + +
+   +
+   +
+   +
{{ offsetMonthTitle() }}
+
+
+
+
diff --git a/src/main/angular/src/app/location/detail/location-detail.ts b/src/main/angular/src/app/location/detail/location-detail.ts index d8ba6ee..18c1dac 100644 --- a/src/main/angular/src/app/location/detail/location-detail.ts +++ b/src/main/angular/src/app/location/detail/location-detail.ts @@ -41,7 +41,9 @@ export class LocationDetail implements OnInit, OnDestroy { private readonly subs: Subscription [] = []; - protected offset: number = 1; + protected offsetDay: number = 0; + + protected offsetMonth: number = 0; private readonly datePipe: DatePipe; @@ -76,16 +78,21 @@ export class LocationDetail implements OnInit, OnDestroy { } protected offsetDayTitle(): string { - if (this.offset === 1) { + if (this.offsetDay === 0) { + return 'Heute'; + } else if (this.offsetDay === 1) { return 'Gestern'; } else { - if (this.offset < 7) { - const d = new Date(this.dateService.now); - d.setDate(d.getDate() - this.offset); - return this.datePipe.transform(d, 'EEEE') || ''; - } - return `Vor ${this.offset} Tagen`; + const d = new Date(this.dateService.now); + d.setDate(d.getDate() - this.offsetDay); + return this.datePipe.transform(d, 'dd.MM.yyyy EEEE') || ''; } } + protected offsetMonthTitle(): string { + const d = new Date(this.dateService.now); + d.setMonth(d.getMonth() - this.offsetMonth); + return this.datePipe.transform(d, 'yyyy MMMM') || ''; + } + } diff --git a/src/main/angular/src/app/series/Interval.ts b/src/main/angular/src/app/series/Interval.ts index c28ec48..06c37fa 100644 --- a/src/main/angular/src/app/series/Interval.ts +++ b/src/main/angular/src/app/series/Interval.ts @@ -8,7 +8,7 @@ export class Interval { static readonly WEEK = new Interval('WEEK', this.HOUR); - static readonly MONTH = new Interval('MONTH', this.HOUR); + static readonly MONTH = new Interval('MONTH', this.DAY); static readonly YEAR = new Interval('YEAR', this.DAY);