logo

pleroma-fe

My custom branche(s) on git.pleroma.social/pleroma/pleroma-fe git clone https://hacktivis.me/git/pleroma-fe.git
commit: 68ef7e4e65ed00b5af85d1b089ca2e629665445a
parent 7a73f2fcd22949cc4af3a1b8e9d043e1be2adc06
Author: Tusooa Zhu <tusooa@kazv.moe>
Date:   Thu, 14 Jul 2022 18:42:28 -0400

Add published time for announcements

Diffstat:

Msrc/components/announcement/announcement.js8++++++++
Msrc/components/announcement/announcement.vue3+++
2 files changed, 11 insertions(+), 0 deletions(-)

diff --git a/src/components/announcement/announcement.js b/src/components/announcement/announcement.js @@ -33,6 +33,14 @@ const Announcement = { isRead () { return this.announcement.read }, + publishedAt () { + const time = this.announcement['published_at'] + if (!time) { + return + } + + return this.formatTimeOrDate(time, localeService.internalToBrowserLocale(this.$i18n.locale)) + }, startsAt () { const time = this.announcement['starts_at'] if (!time) { diff --git a/src/components/announcement/announcement.vue b/src/components/announcement/announcement.vue @@ -20,6 +20,9 @@ v-if="!editing" class="times" > + <span v-if="publishedAt"> + {{ $t('announcements.published_time_display', { time: publishedAt }) }} + </span> <span v-if="startsAt"> {{ $t('announcements.start_time_display', { time: startsAt }) }} </span>