db-vendo-client/format/date.js

13 lines
235 B
JavaScript
Raw Normal View History

2017-11-12 00:45:51 +01:00
'use strict'
const {DateTime} = require('luxon')
2017-11-12 00:45:51 +01:00
const formatDate = (profile, when) => {
return DateTime.fromMillis(+when, {
locale: profile.locale,
zone: profile.timezone
}).toFormat('yyyyMMdd')
2017-11-12 00:45:51 +01:00
}
2017-11-12 00:53:34 +01:00
module.exports = formatDate