Skip to content

Commit

Permalink
remove moment
Browse files Browse the repository at this point in the history
  • Loading branch information
jackkav committed Jan 11, 2024
1 parent 27e66a0 commit e2db0ed
Show file tree
Hide file tree
Showing 4 changed files with 1 addition and 13 deletions.
2 changes: 0 additions & 2 deletions lib/middleware/negotiate-content.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
const moment = require("moment");
const XML = require("xmlbuilder");
const YAML = require("yamljs");

Expand Down Expand Up @@ -41,7 +40,6 @@ module.exports = (req, res, next) => {
}

function HTMLResponse() {
req.app.locals.moment = moment;
XML.create(res.bodyXmlObj, { allowSurrogateChars: true });
res.render(res.view || "default", {
req: req,
Expand Down
9 changes: 0 additions & 9 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,6 @@
"har-validator": "^5.1.3",
"jstransformer-marked": "^1.4.0",
"method-override": "^3.0.0",
"moment": "^2.24.0",
"morgan": "^1.9.1",
"pug": "^2.0.4",
"redis": "^4.6.12",
Expand Down
2 changes: 1 addition & 1 deletion src/views/bin/log.pug
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ block content

td #{entry.request.bodySize / 1000} KB

td.date= moment(entry.startedDateTime).fromNow()
td.date= new Intl.DateTimeFormat('en-US', { weekday: 'short', hour: 'numeric', month:'short', year: 'numeric' }).format(new Date(entry.startedDateTime))
td.ip= entry.clientIPAddress
td.action.text-right
div.btn-group.btn-group-sm
Expand Down

0 comments on commit e2db0ed

Please sign in to comment.