Fix announcements lint

This commit is contained in:
Tusooa Zhu 2022-08-01 11:08:09 -04:00 committed by tusooa
commit 1fc0a8b332
No known key found for this signature in database
GPG key ID: 7B467EDE43A08224
2 changed files with 10 additions and 10 deletions

View file

@ -42,7 +42,7 @@ const Announcement = {
return this.formatTimeOrDate(time, localeService.internalToBrowserLocale(this.$i18n.locale))
},
startsAt () {
const time = this.announcement['starts_at']
const time = this.announcement.starts_at
if (!time) {
return
}
@ -50,7 +50,7 @@ const Announcement = {
return this.formatTimeOrDate(time, localeService.internalToBrowserLocale(this.$i18n.locale))
},
endsAt () {
const time = this.announcement['ends_at']
const time = this.announcement.ends_at
if (!time) {
return
}
@ -72,13 +72,13 @@ const Announcement = {
},
formatTimeOrDate (time, locale) {
const d = new Date(time)
return this.announcement['all_day'] ? d.toLocaleDateString(locale) : d.toLocaleString(locale)
return this.announcement.all_day ? d.toLocaleDateString(locale) : d.toLocaleString(locale)
},
enterEditMode () {
this.editedAnnouncement.content = this.announcement.pleroma['raw_content']
this.editedAnnouncement.startsAt = this.announcement['starts_at']
this.editedAnnouncement.endsAt = this.announcement['ends_at']
this.editedAnnouncement.allDay = this.announcement['all_day']
this.editedAnnouncement.content = this.announcement.pleroma.raw_content
this.editedAnnouncement.startsAt = this.announcement.starts_at
this.editedAnnouncement.endsAt = this.announcement.ends_at
this.editedAnnouncement.allDay = this.announcement.all_day
this.editing = true
},
submitEdit () {