Add const lang = require(flatpickr/dist/l10n/${this.locale}.js
).default[this.locale];
This commit is contained in:
parent
9270e12976
commit
0abb35c2e8
@ -27,8 +27,6 @@
|
||||
<script>
|
||||
import flatPicker from "vue-flatpickr-component";
|
||||
import "flatpickr/dist/flatpickr.css";
|
||||
import { de } from 'flatpickr/dist/l10n/de.js';
|
||||
import { en } from 'flatpickr/dist/l10n/default.js';
|
||||
|
||||
export default {
|
||||
name: 'akaunting-date',
|
||||
@ -73,13 +71,23 @@ export default {
|
||||
icon: {
|
||||
type: String,
|
||||
description: "Prepend icon (left)"
|
||||
},
|
||||
locale: {
|
||||
type: String,
|
||||
default: 'en',
|
||||
}
|
||||
},
|
||||
|
||||
data() {
|
||||
return {
|
||||
real_model: this.model,
|
||||
locale: !this.local ? de : en,
|
||||
}
|
||||
},
|
||||
|
||||
created() {
|
||||
if (this.locale !== 'en') {
|
||||
const lang = require(`flatpickr/dist/l10n/${this.locale}.js`).default[this.locale];
|
||||
this.config.locale = lang;
|
||||
}
|
||||
},
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user