FIX: alignment + offset text display
This commit is contained in:
parent
f0f68f3285
commit
0561940861
@ -6,7 +6,7 @@
|
|||||||
|
|
||||||
<div class="option">
|
<div class="option">
|
||||||
<button class="arrowLeft" (click)="shiftAlignment(+1)">←</button>
|
<button class="arrowLeft" (click)="shiftAlignment(+1)">←</button>
|
||||||
{{ alignment.display }} {{ offset > 0 ? -offset : '' }}
|
{{ offset > 0 ? -offset : '' }}{{ alignment === Alignment.FIVE && offset > 0 ? 'x' : '' }} {{ alignment.display }}{{ offset > 1 ? alignment.plural : '' }}
|
||||||
<button class="arrowRight" (click)="shiftAlignment(-1)">→</button>
|
<button class="arrowRight" (click)="shiftAlignment(-1)">→</button>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|||||||
@ -15,6 +15,8 @@ import {SeriesService} from '../../series/series.service';
|
|||||||
})
|
})
|
||||||
export class ElectroEnergyComponent implements OnInit, OnDestroy {
|
export class ElectroEnergyComponent implements OnInit, OnDestroy {
|
||||||
|
|
||||||
|
protected readonly Alignment = Alignment;
|
||||||
|
|
||||||
protected aggregations: AggregationWrapperDto = AggregationWrapperDto.EMPTY;
|
protected aggregations: AggregationWrapperDto = AggregationWrapperDto.EMPTY;
|
||||||
|
|
||||||
protected alignment: Alignment = Alignment.DAY;
|
protected alignment: Alignment = Alignment.DAY;
|
||||||
|
|||||||
@ -4,21 +4,22 @@ export class Alignment {
|
|||||||
|
|
||||||
private static readonly values: Alignment[] = [];
|
private static readonly values: Alignment[] = [];
|
||||||
|
|
||||||
static readonly FIVE = new Alignment('FIVE', '5 Minuten', Alignment.offsetTitleFive);
|
static readonly FIVE = new Alignment('FIVE', '5 Minuten', '', Alignment.offsetTitleFive);
|
||||||
|
|
||||||
static readonly HOUR = new Alignment('HOUR', 'Stunde', Alignment.offsetTitleHour);
|
static readonly HOUR = new Alignment('HOUR', 'Stunde', 'n', Alignment.offsetTitleHour);
|
||||||
|
|
||||||
static readonly DAY = new Alignment('DAY', 'Tag', Alignment.offsetTitleDay);
|
static readonly DAY = new Alignment('DAY', 'Tag', 'e', Alignment.offsetTitleDay);
|
||||||
|
|
||||||
static readonly WEEK = new Alignment('WEEK', 'Woche', Alignment.offsetTitleWeek);
|
static readonly WEEK = new Alignment('WEEK', 'Woche', 'n', Alignment.offsetTitleWeek);
|
||||||
|
|
||||||
static readonly MONTH = new Alignment('MONTH', 'Monat', Alignment.offsetTitleMonth);
|
static readonly MONTH = new Alignment('MONTH', 'Monat', 'e', Alignment.offsetTitleMonth);
|
||||||
|
|
||||||
static readonly YEAR = new Alignment('YEAR', 'Jahr', Alignment.offsetTitleYear);
|
static readonly YEAR = new Alignment('YEAR', 'Jahr', 'e', Alignment.offsetTitleYear);
|
||||||
|
|
||||||
constructor(
|
constructor(
|
||||||
readonly name: string,
|
readonly name: string,
|
||||||
readonly display: string,
|
readonly display: string,
|
||||||
|
readonly plural: string,
|
||||||
readonly offsetTitle: (offset: number, locale: string) => string
|
readonly offsetTitle: (offset: number, locale: string) => string
|
||||||
) {
|
) {
|
||||||
Alignment.values.push(this);
|
Alignment.values.push(this);
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user