better config / install from cli / allow_registration
This commit is contained in:
@@ -1,31 +1,24 @@
|
||||
import Vue from 'vue'
|
||||
import moment from 'dayjs'
|
||||
import 'dayjs/locale/it'
|
||||
moment.locale(process.env.locale)
|
||||
|
||||
function short_hour(datetime) {
|
||||
if (datetime.minute() === 0) {
|
||||
return datetime.format('HH')
|
||||
} else {
|
||||
return datetime.format('HH:mm')
|
||||
}
|
||||
}
|
||||
|
||||
export default (a) => {
|
||||
export default ({ app }) => {
|
||||
moment.locale(app.i18n.locale)
|
||||
Vue.filter('linkify', value => value.replace(/(https?:\/\/[^\s]+)/g, '<a href="$1">$1</a>'))
|
||||
Vue.filter('datetime', value => moment(value).format('ddd, D MMMM HH:mm'))
|
||||
Vue.filter('short_datetime', value => moment(value).format('D/MM HH:mm'))
|
||||
Vue.filter('hour', value => moment(value).format('HH:mm'))
|
||||
Vue.filter('day', value => moment(value).format('dddd, D MMMM'))
|
||||
Vue.filter('day', value => moment(value*1000).format('dddd, D MMMM'))
|
||||
Vue.filter('month', value => moment(value).format('MMM'))
|
||||
Vue.filter('event_when', event => {
|
||||
const start = moment(event.start_datetime)
|
||||
const end = moment(event.end_datetime)
|
||||
|
||||
const start = moment(event.start_datetime*1000)
|
||||
const end = moment(event.end_datetime*1000)
|
||||
if (event.multidate) {
|
||||
return `${start.format('ddd, D MMMM')} (${short_hour(start)}) - ${end.format('ddd, D MMMM')} (${short_hour(end)})`
|
||||
return `${start.format('ddd, D MMMM (HH:mm)')} - ${end.format('ddd, D MMMM (HH:mm)')}`
|
||||
} else if (event.end_datetime && event.end_datetime !== event.start_datetime)
|
||||
return `${start.format('ddd, D MMMM')} (${short_hour(start)}-${short_hour(end)})`
|
||||
return `${start.format('ddd, D MMMM (HH:mm-')}${end.format('HH:mm)')}`
|
||||
else
|
||||
return `${start.format('dddd, D MMMM')} (${short_hour(start)})`
|
||||
return start.format('dddd, D MMMM (HH:mm)')
|
||||
})
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user