Fixed story chapter fictionalDate field weirdness, especially when it's not provided.
the build was successful
the build was successful
This commit is contained in:
@@ -67,9 +67,11 @@ import moment from "moment"
|
|||||||
<for (paragraph in state.paragraphs)>
|
<for (paragraph in state.paragraphs)>
|
||||||
<div class="message-text color-text">
|
<div class="message-text color-text">
|
||||||
<markdown class="body" source=paragraph>
|
<markdown class="body" source=paragraph>
|
||||||
<span class="decoration color-menu">[</span>
|
<if (input.comment.fictionalDate)>
|
||||||
<date class="color-menu" value=input.comment.fictionalDate></date>
|
<span class="decoration color-menu">[</span>
|
||||||
<span class="decoration color-menu">] </span>
|
<date class="color-menu" value=input.comment.fictionalDate></date>
|
||||||
|
<span class="decoration color-menu">] </span>
|
||||||
|
</if>
|
||||||
<span class="decoration color-menu"><</span>
|
<span class="decoration color-menu"><</span>
|
||||||
<span if(input.comment.character != null) class="tooltip color-primary">
|
<span if(input.comment.character != null) class="tooltip color-primary">
|
||||||
<span>${input.comment.characterName}</span>
|
<span>${input.comment.characterName}</span>
|
||||||
|
|||||||
@@ -28,11 +28,19 @@ module.exports = class {
|
|||||||
})
|
})
|
||||||
|
|
||||||
const comment = input.comment
|
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 = {
|
this.state.values = {
|
||||||
subject: comment.subject,
|
subject: comment.subject,
|
||||||
characterId: comment.characterId,
|
characterId: comment.characterId,
|
||||||
characterName: comment.characterName,
|
characterName: comment.characterName,
|
||||||
fictionalDate: moment(comment.fictionalDate).format("MMM D, YYYY"),
|
fictionalDate: fictionalDate,
|
||||||
source: comment.source,
|
source: comment.source,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user