Skip to content

Commit

Permalink
Fixed formatting of dates to always use UTC timezone
Browse files Browse the repository at this point in the history
  • Loading branch information
yanneves authored and Alastair Lockie committed May 16, 2017
1 parent aebee95 commit ca2a005
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions _includes/helpers/dates.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@

const moment = require('moment')

module.exports.timestamp = date => moment(date).format()
module.exports.day = date => moment(date).format('dddd, DD MMMM YYYY')
module.exports.time = date => moment(date).format('h:mma')
module.exports.timestamp = date => moment.utc(date, 'YYYY-MM-DDTHH:mm:ss.SSSZ').format()
module.exports.day = date => moment.utc(date, 'YYYY-MM-DDTHH:mm:ss.SSSZ').format('dddd, Do MMMM YYYY')
module.exports.time = date => moment.utc(date, 'YYYY-MM-DDTHH:mm:ss.SSSZ').format('h:mma')
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -58,13 +58,13 @@
"metalsmith-layouts": "^1.7.0",
"metalsmith-markdown": "^0.2.1",
"metalsmith-metadata": "0.0.4",
"metalsmith-metadata-in-filename": "^1.1.0",
"metalsmith-metadata-in-filename": "^1.2.0",
"metalsmith-more": "^0.2.0",
"metalsmith-permalinks": "^0.5.0",
"metalsmith-redirect": "^2.1.0",
"metalsmith-register-helpers": "^0.2.0",
"metalsmith-tags": "^2.0.0",
"moment": "^2.17.1",
"moment": "^2.18.1",
"run-sequence": "^1.2.2",
"striptags": "^2.2.1",
"through2": "^2.0.3"
Expand Down

0 comments on commit ca2a005

Please sign in to comment.