Use shorter format for ago dates

This commit is contained in:
Eliot Berriot 2019-03-06 18:42:33 +01:00
parent 666aaf0177
commit 6cfad07870
No known key found for this signature in database
GPG key ID: DD6965E2476E5C27
2 changed files with 19 additions and 3 deletions

View file

@ -17,7 +17,15 @@ export function ago (date, locale) {
locale = locale || 'en'
const m = moment(date)
m.locale(locale)
return m.fromNow()
return m.calendar(null, {
sameDay: 'LT',
nextDay: 'L',
nextWeek: 'L',
lastDay: 'L',
lastWeek: 'L',
sameElse: 'L'
})
}
Vue.filter('ago', ago)