From cebf9a4eae4b5c5eea6b913491866fe903173ab5 Mon Sep 17 00:00:00 2001 From: Kostya Date: Wed, 6 Dec 2023 11:51:54 +0300 Subject: [PATCH] added methods for get data in profilepage --- luckydiamond/src/pages/ProfilePage.vue | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/luckydiamond/src/pages/ProfilePage.vue b/luckydiamond/src/pages/ProfilePage.vue index 9cf64aa..6e15912 100644 --- a/luckydiamond/src/pages/ProfilePage.vue +++ b/luckydiamond/src/pages/ProfilePage.vue @@ -71,6 +71,13 @@ export default { } }, methods: { + formatNumber(number) { + return number < 10 ? `0${number}` : number; + }, + getCurrentFormattedDate() { + const currentDate = new Date(); + return `${this.formatNumber(currentDate.getDate())}.${this.formatNumber(currentDate.getMonth() + 1)}.${currentDate.getFullYear()}, ${this.formatNumber(currentDate.getHours())}:${this.formatNumber(currentDate.getMinutes())}`; + }, depositClick() { this.openModal = true this.payments = true @@ -83,7 +90,7 @@ export default { const historyPayments = { name: 'TEST USER', comment: 'test', - data: '5ч назад', + data: this.getCurrentFormattedDate(), amount: amount } @@ -93,7 +100,7 @@ export default { const historyPayments = { name: 'TEST USER', comment: 'test', - data: '5ч назад', + data: this.getCurrentFormattedDate(), amount: -amount }