Browse Source

story: Changed fictionalDate in story list to be rendered as UTC.

1.0
Gisle Aune 6 years ago
parent
commit
cb2f54cecf
  1. 4
      marko/components/content-list-item/components/item-meta/component.js
  2. 2
      marko/components/content-list-item/index.marko

4
marko/components/content-list-item/components/item-meta/component.js

@ -1,7 +1,7 @@
const moment = require("moment")
module.exports = class {
onCreate({kind, value, updated}) {
onCreate({kind, value, updated, utc}) {
this.state = {text: null, color: "color-menu", tooltip: null}
if (value == null || value == "") {
@ -10,7 +10,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/components/content-list-item/index.marko

@ -15,7 +15,7 @@
</div>
<div class="meta">
<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-meta kind="author" value=input.author />
</div>

Loading…
Cancel
Save