remove v-calendar use v-date-picker

This commit is contained in:
les 2020-10-25 00:34:22 +02:00
parent 743c8729d8
commit 767d7d5ffc
7 changed files with 799 additions and 1876 deletions

View file

@ -41,8 +41,8 @@ module.exports = {
'@/plugins/vue-clipboard', // vuetify
'@/plugins/axios', // axios baseurl configuration
'@/plugins/validators', // inject validators
'@/plugins/api', // api helpers
{ src: '@/plugins/v-calendar', ssr: false } // calendar, fix ssr
'@/plugins/api' // api helpers
// { src: '@/plugins/v-calendar', ssr: false } // calendar, fix ssr
],
render: {

View file

@ -39,9 +39,9 @@
"cors": "^2.8.5",
"cross-env": "^7.0.2",
"date-fns": "^2.16.1",
"dayjs": "^1.9.1",
"dompurify": "^2.1.1",
"email-templates": "^7.1.1",
"dayjs": "^1.9.4",
"dompurify": "^2.2.0",
"email-templates": "^7.1.2",
"express": "^4.17.1",
"express-oauth-server": "^2.0.0",
"fs": "^0.0.1-security",
@ -59,47 +59,47 @@
"moment-timezone": "^0.5.31",
"morgan": "^1.10.0",
"multer": "^1.4.2",
"nuxt": "^2.14.6",
"nuxt": "^2.14.7",
"nuxt-express-module": "^0.0.11",
"pg": "^8.4.1",
"sequelize": "^6.3.5",
"sequelize-cli": "^6.2.0",
"sharp": "^0.26.1",
"sharp": "^0.26.2",
"sqlite3": "^5.0.0",
"tiptap": "^1.30.0",
"tiptap-extensions": "^1.33.1",
"tiptap-extensions": "^1.33.2",
"to-ico": "^1.1.5",
"url": "^0.11.0",
"v-calendar": "^1.0.8",
"v-calendar": "^1.1.1",
"vue-clipboard2": "^0.3.1",
"vue-i18n": "^8.22.0",
"yargs": "^16.0.3"
"vue-i18n": "^8.22.1",
"yargs": "^16.1.0"
},
"devDependencies": {
"@mdi/font": "^5.6.55",
"@nuxtjs/eslint-config": "^3.1.0",
"@mdi/font": "^5.7.55",
"@nuxtjs/eslint-config": "^4.0.0",
"@nuxtjs/vuetify": "^1.11.2",
"babel-eslint": "^10.1.0",
"eslint": "^7.11.0",
"eslint-config-prettier": "^6.12.0",
"eslint-config-standard": ">=14.1.1",
"eslint-config-prettier": "^6.14.0",
"eslint-config-standard": "^15.0.0",
"eslint-loader": "^4.0.2",
"eslint-plugin-import": "^2.22.1",
"eslint-plugin-node": ">=11.1.0",
"eslint-plugin-nuxt": "^1.0.0",
"eslint-plugin-prettier": "^3.1.4",
"eslint-plugin-promise": ">=4.0.1",
"eslint-plugin-standard": ">=4.0.1",
"eslint-plugin-vue": "^7.0.1",
"eslint-plugin-standard": "^4.0.2",
"eslint-plugin-vue": "^7.1.0",
"less-loader": "^7.0.2",
"nodemon": "^2.0.4",
"nodemon": "^2.0.6",
"prettier": "^2.1.2",
"pug-plain-loader": "^1.0.0",
"sass": "^1.27.0",
"sass-loader": "^10.0.3",
"sass-loader": "^10.0.4",
"vue-cli-plugin-vuetify": "~2.0.7",
"vuetify-loader": "^1.3.0",
"webpack-cli": "^4.0.0"
"webpack-cli": "^4.1.0"
},
"resolutions": {
"prosemirror-model": "1.11.2"

View file

@ -1,7 +1,7 @@
import Vue from 'vue'
import VCalendar from 'v-calendar'
export default () => {
Vue.use(VCalendar, {
firstDayOfWeek: 2
})
}
// import Vue from 'vue'
// import VCalendar from 'v-calendar'
// export default () => {
// Vue.use(VCalendar, {
// firstDayOfWeek: 2
// })
// }

View file

@ -1,5 +1,5 @@
const crypto = require('crypto')
const moment = require('moment-timezone')
// const moment = require('moment-timezone')
const path = require('path')
const config = require('config')
const fs = require('fs')
@ -8,6 +8,7 @@ const _ = require('lodash')
const helpers = require('../../helpers')
const linkifyHtml = require('linkifyjs/html')
const Sequelize = require('sequelize')
const dayjs = require('dayjs')
const Event = require('../models/event')
const Resource = require('../models/resource')
@ -217,7 +218,7 @@ const eventController = {
where: {
parentId: null,
is_visible: false,
start_datetime: { [Op.gt]: moment().unix() }
start_datetime: { [Op.gt]: dayjs().unix() }
},
order: [['start_datetime', 'ASC']],
include: [{ model: Tag, required: false }, Place]
@ -417,19 +418,19 @@ const eventController = {
}
},
async _select ({ start, end, tags, places}) {
async _select ({ start, end, tags, places }) {
debug('_select start: %s, end: %s, tags: %s', dayjs.unix(start), end, tags)
const where = {
// confirmed event only
recurrent: null,
is_visible: true,
start_datetime: { [Op.gt]: start },
end_datetime: { [Op.gt]: start }
}
if (end) {
where['end_datetime'] = { [Op.lt]: end }
where.end_datetime = { [Op.lt]: end }
}
if (places) {
where.placeId = places.split(',')
}
@ -448,7 +449,7 @@ const eventController = {
order: ['start_datetime', [Tag, 'weigth', 'DESC']],
include: [
{ model: Resource, required: false, attributes: ['id'] },
{ model: Tag, attributes: ['tag'], required: tags ? true : false, ...where_tags, through: { attributes: [] } },
{ model: Tag, attributes: ['tag'], required: !!tags, ...where_tags, through: { attributes: [] } },
{ model: Place, required: false, attributes: ['id', 'name', 'address'] }
]
})
@ -489,10 +490,10 @@ const eventController = {
}
const recurrent = e.recurrent
const cursor = moment()
const cursor = dayjs()
// let cursor = start.startOf('week')
const start_date = moment.unix(e.start_datetime)
const duration = moment.unix(e.end_datetime).diff(start_date, 's')
const start_date = dayjs.unix(e.start_datetime)
const duration = dayjs.unix(e.end_datetime).diff(start_date, 's')
const frequency = recurrent.frequency
const days = recurrent.days
const type = recurrent.type
@ -532,7 +533,7 @@ const eventController = {
cursor.date(d)
} else {
cursor.day(d - 1)
if (cursor.isBefore(moment())) {
if (cursor.isBefore(dayjs())) {
cursor.day(d - 1 + 7)
}
}
@ -547,7 +548,7 @@ const eventController = {
/**
* Create instances of recurrent events
*/
async _createRecurrent (start_datetime = moment().unix()) {
async _createRecurrent (start_datetime = dayjs().unix()) {
// select recurrent events
const events = await Event.findAll({
where: { is_visible: true, recurrent: { [Op.ne]: null } },

View file

@ -15,7 +15,6 @@ const eventController = require('./api/controller/event')
const announceController = require('./api/controller/announce')
const helpers = require('./helpers')
const { startOfMonth, startOfWeek, getUnixTime } = require('date-fns')
const app = express()
// ignore unimplemented ping url from fediverse

View file

@ -1,6 +1,3 @@
import dayjs from 'dayjs'
import intersection from 'lodash/intersection'
export const state = () => ({
locale: '',
user_locale: {},
@ -81,7 +78,7 @@ export const actions = {
async updateEvent ({ commit }, formData) {
await this.$axios.$put('/event', formData)
},
setFilters({ commit }, filters) {
setFilters ({ commit }, filters) {
commit('setFilters', filters)
},
setAnnouncements ({ commit }, announcements) {

2588
yarn.lock

File diff suppressed because it is too large Load diff