Browse Source

feat(lib): update days to improve readability

pull/6337/head
KenTandrian 1 month ago
parent
commit
7e819f7212
  1. 13
      libs/ui/src/lib/historical-market-data-editor/historical-market-data-editor.component.html
  2. 2
      libs/ui/src/lib/historical-market-data-editor/historical-market-data-editor.component.ts

13
libs/ui/src/lib/historical-market-data-editor/historical-market-data-editor.component.html

@ -3,25 +3,24 @@
<div class="d-flex">
<div class="date mr-1 text-nowrap">{{ itemByMonth.key }}</div>
<div class="align-items-center d-flex flex-grow-1 px-1">
@for (dayItem of days; track dayItem; let i = $index) {
@for (day of days; track day) {
<div
class="day"
[ngClass]="{
'cursor-pointer valid': isDateOfInterest(
`${itemByMonth.key}-${formatDay(i + 1)}`
`${itemByMonth.key}-${formatDay(day)}`
),
available:
marketDataByMonth[itemByMonth.key][formatDay(i + 1)]
?.marketPrice,
today: isToday(`${itemByMonth.key}-${formatDay(i + 1)}`)
marketDataByMonth[itemByMonth.key][formatDay(day)]?.marketPrice,
today: isToday(`${itemByMonth.key}-${formatDay(day)}`)
}"
[title]="
(`${itemByMonth.key}-${formatDay(i + 1)}`
(`${itemByMonth.key}-${formatDay(day)}`
| date: defaultDateFormat()) ?? ''
"
(click)="
onOpenMarketDataDetail({
day: formatDay(i + 1),
day: formatDay(day),
yearMonth: itemByMonth.key
})
"

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

@ -91,7 +91,7 @@ export class GfHistoricalMarketDataEditorComponent
public readonly locale = input(getLocale());
public readonly marketData = input.required<MarketData[]>();
protected readonly days = Array(31);
protected readonly days = Array.from({ length: 31 }, (_, i) => i + 1);
protected readonly defaultDateFormat = computed(() =>
getDateFormatString(this.locale())
);

Loading…
Cancel
Save