feat: change utils.formatDate and utils.formatTimestamp (#3583)

This commit is contained in:
dni ⚡
2025-11-26 18:54:09 +01:00
committed by GitHub
parent 5f1cfc0e37
commit f1f6af0e35
17 changed files with 71 additions and 65 deletions
@@ -124,7 +124,7 @@ window.app.component('lnbits-admin-exchange-providers', {
},
initExchangeChart(data) {
const xValues = data.map(d =>
Quasar.date.formatDate(new Date(d.timestamp * 1000), 'HH:mm')
this.utils.formatTimestamp(d.timestamp, 'HH:mm')
)
const exchanges = [
...this.formData.lnbits_exchange_rate_providers,
@@ -166,16 +166,14 @@ window.app.component('lnbits-payment-list', {
fiat_currency: data.fiat_currency,
labels: data.labels
}
obj.date = moment.utc(data.created_at).local().format(window.dateFormat)
obj.dateFrom = moment.utc(data.created_at).local().fromNow()
obj.expirydate = moment.utc(obj.expiry).local().format(window.dateFormat)
obj.expirydateFrom = moment.utc(obj.expiry).local().fromNow()
obj.date = this.utils.formatDate(data.created_at)
obj.dateFrom = this.utils.formatDateFrom(data.created_at)
obj.expirydate = this.utils.formatDate(data.expiry)
obj.expirydateFrom = this.utils.formatDateFrom(data.expiry)
obj.msat = obj.amount
obj.sat = obj.msat / 1000
obj.tag = obj.extra?.tag
obj.fsat = new Intl.NumberFormat(window.i18n.global.locale).format(
obj.sat
)
obj.fsat = this.utils.formatSat(obj.sat)
obj.isIn = obj.amount > 0
obj.isOut = obj.amount < 0
obj.isPending = obj.status === 'pending'
@@ -15,10 +15,6 @@ window.app.component('lnbits-wallet-paylinks', {
this.storedPaylinks = this.g.wallet.storedPaylinks
},
methods: {
dateFromNow(unix) {
const date = new Date(unix * 1000)
return moment.utc(date).local().fromNow()
},
updatePaylinks() {
LNbits.api
.request(