1
0
Fork 0
mirror of https://github.com/documize/community.git synced 2025-07-24 15:49:44 +02:00

Display local datetimes

From UTC to local.

Closes #156
This commit is contained in:
sauls8t 2018-06-27 13:29:29 +01:00
parent 5ed180396e
commit 13deb55cbb

View file

@ -12,12 +12,15 @@
import { helper } from '@ember/component/helper';
export function formattedDate(params) {
let date = params[0];
let format = params[1];
if (is.undefined(format)) format = 'Do MMMM YYYY, HH:mm';
return moment(params[0]).utc().format(format);
// return moment(params[0]).format(format);
// return moment(params[0]).local().format(format);
// https://momentjs.com/docs/#/manipulating/local/
return moment.utc(date).local().format(format);
// in production with 1.65.4 & 1.67.4...
// return moment(params[0]).utc().format(format);
}
export default helper(formattedDate);