.
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
import Vue from 'vue'
|
||||
import { Button, Select, Tag, Option, Table, FormItem, Card, Row, Col, Upload, Checkbox,
|
||||
Form, Tabs, TabPane, Switch, Input, Loading, TimeSelect, Badge, ButtonGroup, Divider,
|
||||
Form, Tabs, TabPane, Switch, Input, Loading, TimeSelect, Badge, ButtonGroup, Divider, Step, Steps,
|
||||
TableColumn, ColorPicker, Pagination, Popover, Tooltip, Dialog, Calendar, Carousel, CarouselItem,
|
||||
Container, Footer , Timeline, TimelineItem, Menu, MenuItem } from 'element-ui'
|
||||
import localeEn from 'element-ui/lib/locale/lang/en'
|
||||
@@ -11,6 +11,8 @@ locale.use(localeIt)
|
||||
export default () => {
|
||||
Vue.use(Button)
|
||||
Vue.use(Divider)
|
||||
Vue.use(Step)
|
||||
Vue.use(Steps)
|
||||
Vue.use(Checkbox)
|
||||
Vue.use(Upload)
|
||||
Vue.use(ButtonGroup)
|
||||
|
||||
@@ -3,21 +3,31 @@ import moment from 'dayjs'
|
||||
import 'dayjs/locale/it'
|
||||
moment.locale('it')
|
||||
|
||||
function short_hour(datetime) {
|
||||
if (datetime.minute() === 0) {
|
||||
return 'h' + datetime.format('HH')
|
||||
} else {
|
||||
return 'h' + datetime.format('HH:mm')
|
||||
}
|
||||
}
|
||||
|
||||
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'))
|
||||
Vue.filter('day', value => moment(value).format('ddd, D MMM'))
|
||||
Vue.filter('day', value => moment(value).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)
|
||||
if (event.multidate) {
|
||||
return moment(event.start_datetime).format('ddd, D MMMM HH:mm') + ' - ' + moment(event.end_datetime).format('ddd, D MMMM')
|
||||
return `${start.format('ddd, D MMMM')} (${short_hour(start)}) - ${end.format('ddd, D MMMM')} (${short_hour(end)})`
|
||||
} 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')
|
||||
return `${start.format('ddd, D MMMM')} (${short_hour(start)}-${short_hour(end)}`
|
||||
else
|
||||
return moment(event.start_datetime).format('dddd, D MMMM HH:mm')
|
||||
return `${start.format('dddd, D MMMM')} (${short_hour(start)})`
|
||||
}
|
||||
})
|
||||
}
|
||||
@@ -1,9 +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 })
|
||||
// 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 })
|
||||
}
|
||||
|
||||
@@ -24,6 +24,7 @@ import 'vue-awesome/icons/tags'
|
||||
import 'vue-awesome/icons/chevron-right'
|
||||
import 'vue-awesome/icons/chevron-left'
|
||||
import 'vue-awesome/icons/search'
|
||||
import 'vue-awesome/icons/times'
|
||||
|
||||
import Icon from 'vue-awesome/components/Icon'
|
||||
|
||||
|
||||
Reference in New Issue
Block a user