Add relative time to invoice details

This commit is contained in:
ekzyis 2023-11-27 16:54:41 +01:00
parent b2d8c089c9
commit e3ffcb9e26
1 changed files with 3 additions and 2 deletions

View File

@ -30,10 +30,10 @@
{{ invoice.Hash }}
</span>
<span class="mx-3 my-1">created at</span><span class="text-ellipsis overflow-hidden font-mono me-3 my-1">
{{ invoice.CreatedAt }}
{{ invoice.CreatedAt }} ({{ ago(new Date(invoice.CreatedAt)) }})
</span>
<span class="mx-3 my-1">expires at</span><span class="text-ellipsis overflow-hidden font-mono me-3 my-1">
{{ invoice.ExpiresAt }}
{{ invoice.ExpiresAt }} ({{ ago(new Date(invoice.ExpiresAt)) }})
</span>
<span class="mx-3 my-1">sats</span><span class="text-ellipsis overflow-hidden font-mono me-3 my-1">
{{ invoice.Msats / 1000 }}
@ -60,6 +60,7 @@
<script setup>
import { onUnmounted, ref } from 'vue'
import { useRoute, useRouter } from 'vue-router'
import ago from 's-ago'
const router = useRouter()
const route = useRoute()