mirror of
https://code.eliotberriot.com/funkwhale/funkwhale.git
synced 2025-10-05 02:49:24 +02:00
See #170: subscriptions management UI
This commit is contained in:
parent
926a5cfc83
commit
be067b9ee3
13 changed files with 414 additions and 185 deletions
|
@ -38,12 +38,38 @@ export function ago (date, locale) {
|
|||
lastDay: 'L',
|
||||
lastWeek: 'L',
|
||||
sameElse: 'L'
|
||||
})
|
||||
|
||||
})
|
||||
}
|
||||
|
||||
Vue.filter('ago', ago)
|
||||
|
||||
export function fromNow (date, locale) {
|
||||
locale = 'en'
|
||||
moment.locale('en', {
|
||||
relativeTime: {
|
||||
future: 'in %s',
|
||||
past: '%s ago',
|
||||
s: 'seconds',
|
||||
ss: '%ss',
|
||||
m: 'a minute',
|
||||
mm: '%dm',
|
||||
h: 'an hour',
|
||||
hh: '%dh',
|
||||
d: 'a day',
|
||||
dd: '%dd',
|
||||
M: 'a month',
|
||||
MM: '%dM',
|
||||
y: 'a year',
|
||||
yy: '%dY'
|
||||
}
|
||||
});
|
||||
const m = moment(date)
|
||||
m.locale(locale)
|
||||
return m.fromNow(true)
|
||||
}
|
||||
|
||||
Vue.filter('fromNow', fromNow)
|
||||
|
||||
export function secondsToObject (seconds) {
|
||||
let m = moment.duration(seconds, 'seconds')
|
||||
return {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue