Browse Source

feat(lib): change locale to input signal

pull/6337/head
KenTandrian 2 months ago
parent
commit
164beeea92
  1. 6
      libs/ui/src/lib/historical-market-data-editor/historical-market-data-editor.component.ts

6
libs/ui/src/lib/historical-market-data-editor/historical-market-data-editor.component.ts

@ -13,6 +13,7 @@ import {
ChangeDetectionStrategy, ChangeDetectionStrategy,
Component, Component,
EventEmitter, EventEmitter,
input,
Input, Input,
OnChanges, OnChanges,
OnDestroy, OnDestroy,
@ -65,7 +66,6 @@ export class GfHistoricalMarketDataEditorComponent
@Input() currency: string; @Input() currency: string;
@Input() dataSource: DataSource; @Input() dataSource: DataSource;
@Input() dateOfFirstActivity: string; @Input() dateOfFirstActivity: string;
@Input() locale = getLocale();
@Input() marketData: MarketData[]; @Input() marketData: MarketData[];
@Input() symbol: string; @Input() symbol: string;
@Input() user: User; @Input() user: User;
@ -90,6 +90,8 @@ export class GfHistoricalMarketDataEditorComponent
}; };
} = {}; } = {};
public readonly locale = input(getLocale());
protected readonly days = Array(31); protected readonly days = Array(31);
private unsubscribeSubject = new Subject<void>(); private unsubscribeSubject = new Subject<void>();
@ -109,7 +111,7 @@ export class GfHistoricalMarketDataEditorComponent
} }
public ngOnChanges() { public ngOnChanges() {
this.defaultDateFormat = getDateFormatString(this.locale); this.defaultDateFormat = getDateFormatString(this.locale());
this.historicalDataItems = this.marketData.map(({ date, marketPrice }) => { this.historicalDataItems = this.marketData.map(({ date, marketPrice }) => {
return { return {

Loading…
Cancel
Save