Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions client/src/components/ChartWidget/TableWidget.svelte
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
<script>
import { onMount, createEventDispatcher } from 'svelte'
import dayjs from 'dayjs'
import {
Button,
Card,
Expand Down Expand Up @@ -135,6 +136,11 @@
typeSortOrder = 'none'
}
}

const getLatestUpdatedTime = (item) => {
const latestTime = item.updated || item.created || item.datetime
return latestTime ? dayjs(latestTime).format('YYYY-MM-DD HH:mm') : '--'
}
</script>

<Card
Expand All @@ -161,6 +167,7 @@
</TableHeadCell>
<TableHeadCell>{$_('amount')}</TableHeadCell>
<TableHeadCell>{$_('currency')}</TableHeadCell>
<TableHeadCell>{$_('latestUpdatedTime')}</TableHeadCell>
<TableBodyCell><span class="px-4 py-2">{$_('action')}</span></TableBodyCell>
<TableBodyCell><span class="px-4 py-2">{$_('action')}</span></TableBodyCell>
</TableHead>
Expand All @@ -176,6 +183,7 @@
{item.amount}
</TableBodyCell>
<TableBodyCell>{getCurrencyName(item.currency) + ($language ? '' : '')}</TableBodyCell>
<TableBodyCell>{getLatestUpdatedTime(item)}</TableBodyCell>
<TableBodyCell>
<Button
size="sm"
Expand Down Expand Up @@ -218,6 +226,7 @@
{$targetCurrencyName}
</strong>
</TableBodyCell>
<TableBodyCell>--</TableBodyCell>
<TableBodyCell>
<Button size="sm" outline class="border-none focus:ring-0" on:click={onPersistClick}>
<span class="text-mark hover:text-brand font-bold">{$_('persist')}</span>
Expand Down
1 change: 1 addition & 0 deletions client/src/lang/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
"datetime": "Date",
"remark": "Remark",
"currency": "Currency",
"latestUpdatedTime": "Updated",
"insightsNav": "Insights",
"backToHomepage": "Back to Homepage",
"high": "High",
Expand Down
1 change: 1 addition & 0 deletions client/src/lang/fr.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
"datetime": "Date",
"remark": "Remarque",
"currency": "Devise",
"latestUpdatedTime": "Mise a jour",
"insightsNav": "Aperçus",
"backToHomepage": "Retour à l'accueil",
"high": "Élevé",
Expand Down
1 change: 1 addition & 0 deletions client/src/lang/ja.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
"datetime": "日付",
"remark": "備考",
"currency": "通貨",
"latestUpdatedTime": "更新日時",
"insightsNav": "インサイト",
"backToHomepage": "ホームページに戻る",
"high": "高",
Expand Down
1 change: 1 addition & 0 deletions client/src/lang/zh-tw.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
"datetime": "日期",
"remark": "備註",
"currency": "幣種",
"latestUpdatedTime": "更新時間",
"insightsNav": "見解",
"backToHomepage": "返回主頁",
"high": "高",
Expand Down
1 change: 1 addition & 0 deletions client/src/lang/zh.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
"datetime": "日期",
"remark": "备注",
"currency": "币种",
"latestUpdatedTime": "更新时间",
"insightsNav": "见解",
"backToHomepage": "返回主页",
"high": "高",
Expand Down
2 changes: 2 additions & 0 deletions client/src/typings/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ export interface AssetsItem {
datetime: string
note: string
tags?: string
created?: string
updated?: string
}

export interface Settings {
Expand Down