do not use end time when not used, fix #233

This commit is contained in:
lesion
2023-02-04 10:42:06 +01:00
parent 9d17770c3d
commit a36c8c29cb
2 changed files with 12 additions and 5 deletions

View File

@@ -69,7 +69,7 @@ module.exports = (sequelize, DataTypes) => {
url: `${config.baseurl}/event/${this.slug || this.id}`,
type: 'Event',
startTime: dayjs.unix(this.start_datetime).tz().locale(locale).format(),
endTime: this.end_datetime ? dayjs.unix(this.end_datetime).tz().locale(locale).format() : null,
...( this.end_datetime ? { endTime : dayjs.unix(this.end_datetime).tz().locale(locale).format() } : {} ),
location: {
name: this.place.name,
address: this.place.address,