Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
d2194347fd | ||
|
|
f850e383b1 | ||
|
|
cb2f54cecf |
@@ -1,7 +1,7 @@
|
|||||||
const moment = require("moment")
|
const moment = require("moment")
|
||||||
|
|
||||||
module.exports = class {
|
module.exports = class {
|
||||||
onCreate({kind, value, updated}) {
|
onCreate({kind, value, updated, utc}) {
|
||||||
this.state = {text: null, color: "color-menu", tooltip: null}
|
this.state = {text: null, color: "color-menu", tooltip: null}
|
||||||
|
|
||||||
if (value == null || value == "") {
|
if (value == null || value == "") {
|
||||||
@@ -10,7 +10,7 @@ module.exports = class {
|
|||||||
|
|
||||||
switch (kind) {
|
switch (kind) {
|
||||||
case "date": {
|
case "date": {
|
||||||
const m = moment(value)
|
const m = utc ? moment.utc(value) : moment(value)
|
||||||
if (m.year() < 2) {
|
if (m.year() < 2) {
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -15,7 +15,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="meta">
|
<div class="meta">
|
||||||
<item-meta kind="date" value=input.createdDate updated=input.updatedDate />
|
<item-meta kind="date" value=input.createdDate updated=input.updatedDate />
|
||||||
<item-meta kind="date" value=input.fictionalDate />
|
<item-meta kind="date" value=input.fictionalDate utc=true />
|
||||||
<item-tag-list tags=input.tags enableAllTags=input.enableAllTags />
|
<item-tag-list tags=input.tags enableAllTags=input.enableAllTags />
|
||||||
<item-meta kind="author" value=input.author />
|
<item-meta kind="author" value=input.author />
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -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}
|
this.state = {text: null, color: "color-menu", href: null, tooltip: null}
|
||||||
|
|
||||||
if (value == null || value == "") {
|
if (value == null || value == "") {
|
||||||
@@ -20,7 +20,7 @@ module.exports = class {
|
|||||||
|
|
||||||
switch (kind) {
|
switch (kind) {
|
||||||
case "date": {
|
case "date": {
|
||||||
const m = moment(value)
|
const m = utc ? moment.utc(value) : moment(value)
|
||||||
if (m.year() < 2) {
|
if (m.year() < 2) {
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ import moment from "moment"
|
|||||||
</if-permitted>
|
</if-permitted>
|
||||||
</div>
|
</div>
|
||||||
<chapter-meta kind="title" value=input.chapter.title />
|
<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="date" value=input.chapter.createdDate />
|
||||||
<chapter-meta weak kind="author" value=input.chapter.author />
|
<chapter-meta weak kind="author" value=input.chapter.author />
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -16,7 +16,7 @@ module.exports = class {
|
|||||||
if (chapter.title) {
|
if (chapter.title) {
|
||||||
title = chapter.title
|
title = chapter.title
|
||||||
} else if (chapter.fictionalDate && chapter.fictionalDate.getUTCFullYear() > 1) {
|
} else if (chapter.fictionalDate && chapter.fictionalDate.getUTCFullYear() > 1) {
|
||||||
title = moment(chapter.fictionalDate).format("MMM D, YYYY")
|
title = moment.utc(chapter.fictionalDate).format("MMM D, YYYY")
|
||||||
}
|
}
|
||||||
|
|
||||||
return title
|
return title
|
||||||
|
|||||||
Reference in New Issue
Block a user