Closed zoat closed 7 years ago
Hi @zoat,
You will need to set the locale
key in the fullcalendar config and import the corresponding fullcalendar locale library. I think something like this should work...
<template>
<full-calendar :config="config" />
</template>
<script>
import 'fullcalendar/dist/locale/fr'
export default {
data() {
return {
config: {
locale: 'fr',
},
}
},
}
</script>
For more details, see their official docs
thank for your answer I try your answer and after npm run dev
I have : Uncaught TypeError: Cannot read property 'datepickerLocale' of undefined at Object.eval (webpack-internal:///202:4) at eval (webpack-internal:///202:3)
Ok, I will have a try after lunch. It may have changed since I last looked at it.
thanks brockReece
So, it is working on my example app. The only difference to the code above was I had to put in a comment to keep eslint happy.
/* eslint-disable import/no-extraneous-dependencies */
import 'fullcalendar/dist/locale/fr';
What version of vue-full-calendar are you using?
i am using "vue-full-calendar": "^2.1.2", I create my app with vu-cli and in my main.js
Vue.config.productionTip = false;
import FullCalendar from 'vue-full-calendar'
/ eslint-disable no-new /
Vue.config.productionTip = false;
new Vue({
el: '#app',
router,
template: '
and the error is
Uncaught TypeError: Cannot read property 'datepickerLocale' of undefined
at Object.eval (webpack-internal:///202:4)
at eval (webpack-internal:///202:3)
at eval (webpack-internal:///202:4)
at Object.
So you are not importing the locale lib?
import 'fullcalendar/dist/locale/fr';
Unless I am missing something?
yes I import 'fullcalendar/dist/locale/fr and also moment js but still have [WDS] Warnings while compiling. msgWarnings @ client?cd17:144 client?cd17:147 ./node_modules/moment/src/lib/locale/locales.js Module not found: Error: Can't resolve './locale' in my-project\node_modules\moment\src\lib\locale' @ ./node_modules/moment/src/lib/locale/locales.js 65:16-60 @ ./node_modules/moment/src/lib/locale/locale.js @ ./node_modules/moment/src/moment.js @ ./node_modules/babel-loader/lib!./node_modules/vue-loader/lib/selector.js?type=script&index=0!./src/App.vue @ ./src/App.vue @ ./src/main.js @ multi (webpack)-dev-server/client?http://localhost:8080 webpack/hot/dev-server ./src/main.js msgWarnings @ client?cd17:147
This is a different error... It looks like you are trying to import a file that doesn't exist. I think your moment locale import statement should look something like this...
import 'moment/src/locale/fr'
Actually, just found this in moment`s issues
https://github.com/moment/moment/issues/4216
Looks like its a problem with the 2.19.0 version of moment
thanks it work !!! I fix moment version in 2.18.1
Perfect. Glad I could help.
I am searching the way to put vue-fullcalendar in french. Thanks