diff options
| author | Tusooa Zhu <tusooa@kazv.moe> | 2022-07-14 18:42:28 -0400 |
|---|---|---|
| committer | tusooa <tusooa@kazv.moe> | 2022-11-24 18:29:31 -0500 |
| commit | 68ef7e4e65ed00b5af85d1b089ca2e629665445a (patch) | |
| tree | 0592e673e46954613ceeea0e1577f7730c9eb307 /src/components/announcement/announcement.js | |
| parent | 7a73f2fcd22949cc4af3a1b8e9d043e1be2adc06 (diff) | |
Add published time for announcements
Diffstat (limited to 'src/components/announcement/announcement.js')
| -rw-r--r-- | src/components/announcement/announcement.js | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/components/announcement/announcement.js b/src/components/announcement/announcement.js index 20f8c62f..993e3655 100644 --- 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) { |
