Browse Source

story-content: Fixed fictional dates not being UTC.

1.0 1.0.9
Gisle Aune 6 years ago
parent
commit
f850e383b1
  1. 4
      marko/page/story-content/components/chapter-meta/component.js
  2. 2
      marko/page/story-content/components/chapter/index.marko

4
marko/page/story-content/components/chapter-meta/component.js

@ -11,7 +11,7 @@ module.exports = class {
}
}
updateState({kind, weak, value, updated}) {
updateState({kind, weak, value, utc, updated}) {
this.state = {text: null, color: "color-menu", href: null, tooltip: null}
if (value == null || value == "") {
@ -20,7 +20,7 @@ module.exports = class {
switch (kind) {
case "date": {
const m = moment(value)
const m = utc ? moment.utc(value) : moment(value)
if (m.year() < 2) {
break
}

2
marko/page/story-content/components/chapter/index.marko

@ -12,7 +12,7 @@ import moment from "moment"
</if-permitted>
</div>
<chapter-meta kind="title" value=input.chapter.title />
<chapter-meta kind="date" value=input.chapter.fictionalDate />
<chapter-meta kind="date" utc=true value=input.chapter.fictionalDate />
<chapter-meta weak kind="date" value=input.chapter.createdDate />
<chapter-meta weak kind="author" value=input.chapter.author />
</div>

Loading…
Cancel
Save