Fixed story chapter fictionalDate field weirdness, especially when it's not provided.
the build was successful

This commit is contained in:
2019-03-17 21:59:50 +01:00
parent 853076fd5e
commit 3a057f6f24
2 changed files with 14 additions and 4 deletions
@@ -28,11 +28,19 @@ module.exports = class {
})
const comment = input.comment
let fictionalDate = new Date(comment.fictionalDate)
if (comment.fictionalDate && !Number.isNaN(fictionalDate.getTime()) && fictionalDate.getTime() !== 0) {
fictionalDate = moment(fictionalDate).format("MMM D, YYYY")
} else {
fictionalDate = ""
}
this.state.values = {
subject: comment.subject,
characterId: comment.characterId,
characterName: comment.characterName,
fictionalDate: moment(comment.fictionalDate).format("MMM D, YYYY"),
fictionalDate: fictionalDate,
source: comment.source,
}
}