From d0a9873a0709e1d6907854a4c21f081dc735ed0f Mon Sep 17 00:00:00 2001 From: Eliot Berriot Date: Thu, 22 Feb 2018 23:34:31 +0100 Subject: [PATCH] Moment format filter --- front/src/filters.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/front/src/filters.js b/front/src/filters.js index 1ec4f2307..22d93149b 100644 --- a/front/src/filters.js +++ b/front/src/filters.js @@ -28,6 +28,13 @@ export function ago (date) { Vue.filter('ago', ago) +export function momentFormat (date, format) { + format = format || 'lll' + return moment(date).format(format) +} + +Vue.filter('moment', momentFormat) + export function capitalize (str) { return str.charAt(0).toUpperCase() + str.slice(1) }