Fix #670: Use proper locale for date-related/duration strings

This commit is contained in:
Eliot Berriot 2019-01-25 11:34:30 +01:00
parent e4cb036a97
commit 7d003282eb
No known key found for this signature in database
GPG key ID: DD6965E2476E5C27
7 changed files with 45 additions and 25 deletions

View file

@ -13,8 +13,10 @@ export function truncate (str, max, ellipsis) {
Vue.filter('truncate', truncate)
export function ago (date) {
export function ago (date, locale) {
locale = locale || 'en'
const m = moment(date)
m.locale(locale)
return m.fromNow()
}