fix: last_payment on userlist was broken (#2796)

* fix: last_payment on userlist was broken
This commit is contained in:
dni ⚡
2024-12-10 11:48:43 +01:00
committed by GitHub
parent 7ee78248b7
commit 5a1d660c7b
5 changed files with 15 additions and 14 deletions

File diff suppressed because one or more lines are too long

View File

@@ -104,6 +104,9 @@ window.app = Vue.createApp({
},
methods: {
formatDate(dateString) {
return LNbits.utils.formatDateString(dateString)
},
async fetchAudit(props) {
try {
const params = LNbits.utils.prepareFilterQuery(this.auditTable, props)
@@ -198,9 +201,6 @@ window.app = Vue.createApp({
this.auditDetailsDialog.data = JSON.stringify(details, null, 4)
this.auditDetailsDialog.show = true
},
formatDate: function (value) {
return Quasar.date.formatDate(new Date(value), 'YYYY-MM-DD HH:mm')
},
shortify(value) {
valueLength = (value || '').length
if (valueLength <= 10) {

View File

@@ -1,4 +1,5 @@
window.LOCALE = 'en'
window.dateFormat = 'YYYY-MM-DD HH:mm'
window.i18n = new VueI18n.createI18n({
locale: window.LOCALE,
fallbackLocale: window.LOCALE,
@@ -274,11 +275,11 @@ window.LNbits = {
fiat_currency: data.fiat_currency
}
obj.date = Quasar.date.formatDate(new Date(obj.time), 'YYYY-MM-DD HH:mm')
obj.date = Quasar.date.formatDate(new Date(obj.time), window.dateFormat)
obj.dateFrom = moment(obj.date).fromNow()
obj.expirydate = Quasar.date.formatDate(
new Date(obj.expiry),
'YYYY-MM-DD HH:mm'
window.dateFormat
)
obj.expirydateFrom = moment(obj.expirydate).fromNow()
obj.msat = obj.amount
@@ -322,12 +323,15 @@ window.LNbits = {
.join('')
return hashHex
},
formatDate: function (timestamp) {
formatDate(timestamp) {
return Quasar.date.formatDate(
new Date(timestamp * 1000),
'YYYY-MM-DD HH:mm'
window.dateFormat
)
},
formatDateString(isoDateString) {
return Quasar.date.formatDate(new Date(isoDateString), window.dateFormat)
},
formatCurrency: function (value, currency) {
return new Intl.NumberFormat(window.LOCALE, {
style: 'currency',

View File

@@ -248,10 +248,7 @@ window.app.component('lnbits-date', {
props: ['ts'],
computed: {
date: function () {
return Quasar.date.formatDate(
new Date(this.ts * 1000),
'YYYY-MM-DD HH:mm'
)
return LNbits.utils.formatDate(this.ts)
},
dateFrom: function () {
return moment(this.date).fromNow()

View File

@@ -172,8 +172,8 @@ window.app = Vue.createApp({
},
methods: {
formatDate: function (value) {
return LNbits.utils.formatDate(value)
formatDate(date) {
return LNbits.utils.formatDateString(date)
},
formatSat: function (value) {
return LNbits.utils.formatSat(Math.floor(value / 1000))