Moment format filter

This commit is contained in:
Eliot Berriot 2018-02-22 23:34:31 +01:00
parent 2cd90ff4bd
commit d0a9873a07
No known key found for this signature in database
GPG Key ID: DD6965E2476E5C27
1 changed files with 7 additions and 0 deletions

View File

@ -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)
}