Parse dates nicely with Moment.js
So we can see them all in a standard format 🙂
This commit is contained in:
parent
42bd4de7ad
commit
41a095e465
3 changed files with 10 additions and 3 deletions
5
index.js
5
index.js
|
@ -1,5 +1,6 @@
|
|||
const express = require("express")
|
||||
const bodyParser = require("body-parser")
|
||||
const moment = require("moment")
|
||||
const Airtable = require("airtable")
|
||||
|
||||
// Let's load some configuration!
|
||||
|
@ -57,8 +58,8 @@ app.post("/edcal", (req, res) => {
|
|||
articles.push({
|
||||
title: record.get("Title"),
|
||||
author: record.get("Author"),
|
||||
due_date: record.get("Due Date"),
|
||||
publish_date: record.get("Publish Date"),
|
||||
due_date: moment(record.get("Due Date")).format("DD MMM"),
|
||||
publish_date: moment(record.get("Publish Date")).format("DD MMM YYYY"),
|
||||
in_charge: record.get("In charge"),
|
||||
status: record.get("Status"),
|
||||
})
|
||||
|
|
|
@ -11,6 +11,7 @@
|
|||
"airtable": "^0.10.1",
|
||||
"body-parser": "^1.19.0",
|
||||
"dotenv": "^8.2.0",
|
||||
"express": "^4.17.1"
|
||||
"express": "^4.17.1",
|
||||
"moment": "^2.29.1"
|
||||
}
|
||||
}
|
||||
|
|
|
@ -273,6 +273,11 @@ mime@1.6.0:
|
|||
resolved "https://registry.yarnpkg.com/mime/-/mime-1.6.0.tgz#32cd9e5c64553bd58d19a568af452acff04981b1"
|
||||
integrity sha512-x0Vn8spI+wuJ1O6S7gnbaQg8Pxh4NNHb7KSINmEWKiPE4RKOplvijn+NkmYmmRgP68mc70j2EbeTFRsrswaQeg==
|
||||
|
||||
moment@^2.29.1:
|
||||
version "2.29.1"
|
||||
resolved "https://registry.yarnpkg.com/moment/-/moment-2.29.1.tgz#b2be769fa31940be9eeea6469c075e35006fa3d3"
|
||||
integrity sha512-kHmoybcPV8Sqy59DwNDY3Jefr64lK/by/da0ViFcuA4DH0vQg5Q6Ze5VimxkfQNSC+Mls/Kx53s7TjP1RhFEDQ==
|
||||
|
||||
ms@2.0.0:
|
||||
version "2.0.0"
|
||||
resolved "https://registry.yarnpkg.com/ms/-/ms-2.0.0.tgz#5608aeadfc00be6c2901df5f9861788de0d597c8"
|
||||
|
|
Loading…
Reference in a new issue