diff --git a/src/modules/wallet/services/WalletService.ts b/src/modules/wallet/services/WalletService.ts index fac772a..598c355 100644 --- a/src/modules/wallet/services/WalletService.ts +++ b/src/modules/wallet/services/WalletService.ts @@ -268,16 +268,35 @@ export default class WalletService extends BaseService { const payments = await response.json() // Transform to our transaction format - this._transactions.value = payments.map((payment: any) => ({ - id: payment.payment_hash, - amount: Math.abs(payment.amount) / 1000, - description: payment.memo || payment.description || 'No description', - timestamp: payment.time ? new Date(payment.time * 1000) : new Date(), - type: payment.amount > 0 ? 'received' : 'sent', - status: payment.pending ? 'pending' : 'confirmed', - fee: payment.fee ? payment.fee / 1000 : undefined, - tag: payment.tag || (payment.extra && payment.extra.tag) || null - })).sort((a: PaymentTransaction, b: PaymentTransaction) => + this._transactions.value = payments.map((payment: any) => { + let timestamp = new Date() + + if (payment.time) { + // Check if it's an ISO string or Unix timestamp + if (typeof payment.time === 'string' && payment.time.includes('T')) { + // ISO string format (e.g., "2025-09-14T16:49:40.378877+00:00") + timestamp = new Date(payment.time) + } else if (typeof payment.time === 'number' || !isNaN(Number(payment.time))) { + // Unix timestamp (seconds) - multiply by 1000 for milliseconds + timestamp = new Date(Number(payment.time) * 1000) + } else { + // Try to parse as-is + timestamp = new Date(payment.time) + } + } + + + return { + id: payment.payment_hash, + amount: Math.abs(payment.amount) / 1000, + description: payment.memo || payment.description || 'No description', + timestamp: timestamp, + type: payment.amount > 0 ? 'received' : 'sent', + status: payment.pending ? 'pending' : 'confirmed', + fee: payment.fee ? payment.fee / 1000 : undefined, + tag: payment.tag || (payment.extra && payment.extra.tag) || null + } + }).sort((a: PaymentTransaction, b: PaymentTransaction) => b.timestamp.getTime() - a.timestamp.getTime() ) diff --git a/src/modules/wallet/views/WalletPage.vue b/src/modules/wallet/views/WalletPage.vue index b72f6a6..c638700 100644 --- a/src/modules/wallet/views/WalletPage.vue +++ b/src/modules/wallet/views/WalletPage.vue @@ -178,52 +178,134 @@ onMounted(() => {
{{ tx.description }}
-+ {{ tx.type === 'received' ? '+' : '-' }}{{ tx.amount.toLocaleString() }} +
+sats
{{ tx.description }}
+- {{ tx.type === 'received' ? '+' : '-' }} - {{ tx.amount.toLocaleString() }} sats -
-- Fee: {{ tx.fee }} sats -
+ + +{{ tx.description }}
++ {{ tx.type === 'received' ? '+' : '-' }} + {{ tx.amount.toLocaleString() }} sats +
++ Fee: {{ tx.fee }} sats +
+