story: Fixed author/month not showing in menu, reordered menu.
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
const moment = require("moment")
|
||||
const express = require("express")
|
||||
const router = express.Router()
|
||||
|
||||
@@ -16,11 +17,10 @@ router.get("/:yearmonth(\-{0,1}[0-9]{4}\-[0-9]{1,2})", common, async(req, res) =
|
||||
// Month is zero-based, while input is one-based.
|
||||
const fromDate = new Date(Date.UTC(year, month - 1, 1))
|
||||
const toDate = new Date(Date.UTC(year, month, 1))
|
||||
const monthStr = `${fromDate}-${month > 9 ? month : '0' + month}`
|
||||
|
||||
res.markoAsync(listTemplate, {
|
||||
stories: storyApi.list({earliestFictionalDate: fromDate, latestFictionalDate: toDate}),
|
||||
menuMonth: monthStr,
|
||||
menuMonth: {url: moment.utc(fromDate).format("YYYY-MM"), text: moment.utc(fromDate).format("MMMM YYYY")},
|
||||
selected: {special: "month"},
|
||||
})
|
||||
} catch(err) {
|
||||
|
||||
Reference in New Issue
Block a user