Browse Source

api: Fixed fictionalDate being set to Jan 1 1970 instead of null in Story and Chapter.

1.0
Gisle Aune 6 years ago
parent
commit
ed5e3fa8ea
  1. 2
      rpdata/api/Chapter.js
  2. 2
      rpdata/api/Story.js

2
rpdata/api/Chapter.js

@ -16,7 +16,7 @@ class Chapter {
this.author = author
this.source = source
this.createdDate = new Date(createdDate)
this.fictionalDate = new Date(fictionalDate)
this.fictionalDate = fictionalDate != null ? new Date(fictionalDate) : null
this.editedDate = new Date(editedDate)
}

2
rpdata/api/Story.js

@ -23,7 +23,7 @@ class Story {
this.category = category
this.createdDate = new Date(createdDate)
this.updatedDate = new Date(updatedDate)
this.fictionalDate = new Date(fictionalDate)
this.fictionalDate = fictionalDate != null ? new Date(fictionalDate) : null
this.tags = tags.map(dt => new Tag(dt.kind, dt.name))
this.chapters = chapters != null ? chapters.map(c => new Chapter(c.id, c.title, c.author, c.source, c.createdDate, c.fictionalDate, c.editedDate)) : null
}

Loading…
Cancel
Save