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>
|
<script>
|
||||||
import flatPicker from "vue-flatpickr-component";
|
import flatPicker from "vue-flatpickr-component";
|
||||||
import "flatpickr/dist/flatpickr.css";
|
import "flatpickr/dist/flatpickr.css";
|
||||||
import { de } from 'flatpickr/dist/l10n/de.js';
|
|
||||||
import { en } from 'flatpickr/dist/l10n/default.js';
|
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'akaunting-date',
|
name: 'akaunting-date',
|
||||||
@ -73,13 +71,23 @@ export default {
|
|||||||
icon: {
|
icon: {
|
||||||
type: String,
|
type: String,
|
||||||
description: "Prepend icon (left)"
|
description: "Prepend icon (left)"
|
||||||
|
},
|
||||||
|
locale: {
|
||||||
|
type: String,
|
||||||
|
default: 'en',
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
real_model: this.model,
|
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