Fix announcements lint
This commit is contained in:
parent
d74d5a8ce2
commit
1fc0a8b332
|
@ -42,7 +42,7 @@ const Announcement = {
|
||||||
return this.formatTimeOrDate(time, localeService.internalToBrowserLocale(this.$i18n.locale))
|
return this.formatTimeOrDate(time, localeService.internalToBrowserLocale(this.$i18n.locale))
|
||||||
},
|
},
|
||||||
startsAt () {
|
startsAt () {
|
||||||
const time = this.announcement['starts_at']
|
const time = this.announcement.starts_at
|
||||||
if (!time) {
|
if (!time) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
@ -50,7 +50,7 @@ const Announcement = {
|
||||||
return this.formatTimeOrDate(time, localeService.internalToBrowserLocale(this.$i18n.locale))
|
return this.formatTimeOrDate(time, localeService.internalToBrowserLocale(this.$i18n.locale))
|
||||||
},
|
},
|
||||||
endsAt () {
|
endsAt () {
|
||||||
const time = this.announcement['ends_at']
|
const time = this.announcement.ends_at
|
||||||
if (!time) {
|
if (!time) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
@ -72,13 +72,13 @@ const Announcement = {
|
||||||
},
|
},
|
||||||
formatTimeOrDate (time, locale) {
|
formatTimeOrDate (time, locale) {
|
||||||
const d = new Date(time)
|
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 () {
|
enterEditMode () {
|
||||||
this.editedAnnouncement.content = this.announcement.pleroma['raw_content']
|
this.editedAnnouncement.content = this.announcement.pleroma.raw_content
|
||||||
this.editedAnnouncement.startsAt = this.announcement['starts_at']
|
this.editedAnnouncement.startsAt = this.announcement.starts_at
|
||||||
this.editedAnnouncement.endsAt = this.announcement['ends_at']
|
this.editedAnnouncement.endsAt = this.announcement.ends_at
|
||||||
this.editedAnnouncement.allDay = this.announcement['all_day']
|
this.editedAnnouncement.allDay = this.announcement.all_day
|
||||||
this.editing = true
|
this.editing = true
|
||||||
},
|
},
|
||||||
submitEdit () {
|
submitEdit () {
|
||||||
|
|
|
@ -1387,15 +1387,15 @@ const announcementToPayload = ({ content, startsAt, endsAt, allDay }) => {
|
||||||
const payload = { content }
|
const payload = { content }
|
||||||
|
|
||||||
if (typeof startsAt !== 'undefined') {
|
if (typeof startsAt !== 'undefined') {
|
||||||
payload['starts_at'] = startsAt ? new Date(startsAt).toISOString() : null
|
payload.starts_at = startsAt ? new Date(startsAt).toISOString() : null
|
||||||
}
|
}
|
||||||
|
|
||||||
if (typeof endsAt !== 'undefined') {
|
if (typeof endsAt !== 'undefined') {
|
||||||
payload['ends_at'] = endsAt ? new Date(endsAt).toISOString() : null
|
payload.ends_at = endsAt ? new Date(endsAt).toISOString() : null
|
||||||
}
|
}
|
||||||
|
|
||||||
if (typeof allDay !== 'undefined') {
|
if (typeof allDay !== 'undefined') {
|
||||||
payload['all_day'] = allDay
|
payload.all_day = allDay
|
||||||
}
|
}
|
||||||
|
|
||||||
return payload
|
return payload
|
||||||
|
|
Loading…
Reference in New Issue