.
This commit is contained in:
@@ -4,7 +4,7 @@ import 'dayjs/locale/it'
|
||||
moment.locale('it')
|
||||
|
||||
export default (a) => {
|
||||
|
||||
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'))
|
||||
@@ -12,7 +12,7 @@ export default (a) => {
|
||||
Vue.filter('month', value => moment(value).format('MMM'))
|
||||
Vue.filter('event_when', event => {
|
||||
if (event.multidate) {
|
||||
return moment(event.start_datetime).format('dddd, D MMMM HH:mm') + ' - ' + moment(event.end_datetime).format('ddd, D MMMM')
|
||||
return moment(event.start_datetime).format('ddd, D MMMM HH:mm') + ' - ' + moment(event.end_datetime).format('ddd, D MMMM')
|
||||
} else {
|
||||
if (event.end_datetime && event.end_datetime !== event.start_datetime)
|
||||
return moment(event.start_datetime).format('dddd, D MMMM HH:mm') + '-' + moment(event.end_datetime).format('HH:mm')
|
||||
|
||||
9
plugins/initialize.js
Normal file
9
plugins/initialize.js
Normal file
@@ -0,0 +1,9 @@
|
||||
|
||||
// TOFIX: not needed in any case (eg. embed)
|
||||
export default async ({ store, $axios }) => {
|
||||
const now = new Date()
|
||||
const events = await $axios.$get(`/event/${now.getMonth()}/${now.getFullYear()}`)
|
||||
store.commit('setEvents', events)
|
||||
const { tags, places } = await $axios.$get('/event/meta')
|
||||
store.commit('update', { tags, places })
|
||||
}
|
||||
Reference in New Issue
Block a user