Skip to content

Commit 882c1d4

Browse files
committed
Fixed issue connected with configs
1 parent 4ad1c76 commit 882c1d4

File tree

2 files changed

+12
-16
lines changed

2 files changed

+12
-16
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
},
77
"name": "vue-functional-calendar",
88
"description": "Lightweight, high-performance calendar component based on Vue.js",
9-
"version": "2.5.5",
9+
"version": "2.5.7",
1010
"license": "MIT",
1111
"repository": {
1212
"type": "git",

src/components/FunctionalCalendar.vue

Lines changed: 11 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -328,9 +328,10 @@
328328
},
329329
setConfigs() {
330330
let vm = this;
331+
let globalOptions;
331332
if (typeof vm.$getOptions !== "undefined") {
332333
// Global Options
333-
let globalOptions = vm.$getOptions();
334+
globalOptions = vm.$getOptions();
334335
Object.keys(globalOptions).map(function (objectKey) {
335336
if (typeof (vm.fConfigs[objectKey]) !== "undefined") {
336337
vm.$set(vm.fConfigs, objectKey, globalOptions[objectKey]);
@@ -339,39 +340,34 @@
339340
}
340341
341342
342-
if (typeof (this.configs) !== "undefined") {
343-
Object.keys(this.fConfigs).map(function (objectKey) {
343+
if (typeof (vm.configs) !== "undefined") {
344+
Object.keys(vm.fConfigs).map(function (objectKey) {
344345
if (typeof (vm.configs[objectKey]) !== "undefined") {
345346
// Get From Configs
346347
vm.$set(vm.fConfigs, objectKey, vm.configs[objectKey]);
347-
} else {
348-
// Get From Props
349-
if (typeof (globalOptions[objectKey]) === "undefined") {
350-
vm.$set(vm.fConfigs, objectKey, vm.$props[objectKey]);
351-
}
352348
}
353349
});
354350
} else {
355-
Object.keys(this.$props).map(function (objectKey) {
351+
Object.keys(vm.$props).map(function (objectKey) {
356352
if (typeof (vm.fConfigs[objectKey]) !== "undefined" && typeof (vm.$props[objectKey]) !== "undefined") {
357353
vm.$set(vm.fConfigs, objectKey, vm.$props[objectKey]);
358354
}
359355
});
360356
}
361357
362358
// Is Modal
363-
if (this.fConfigs.isModal) this.showCalendar = false;
359+
if (vm.fConfigs.isModal) vm.showCalendar = false;
364360
365361
// Placeholder
366-
if (!this.fConfigs.placeholder) this.fConfigs.placeholder = this.fConfigs.dateFormat;
362+
if (!vm.fConfigs.placeholder) vm.fConfigs.placeholder = vm.fConfigs.dateFormat;
367363
368-
if (typeof this.newCurrentDate !== "undefined") {
369-
this.calendar.currentDate = this.newCurrentDate;
364+
if (typeof vm.newCurrentDate !== "undefined") {
365+
vm.calendar.currentDate = vm.newCurrentDate;
370366
}
371367
372368
// Sunday Start
373-
if (this.fConfigs.sundayStart) {
374-
let dayNames = this.fConfigs.dayNames;
369+
if (vm.fConfigs.sundayStart) {
370+
let dayNames = vm.fConfigs.dayNames;
375371
let sundayName = dayNames[dayNames.length - 1];
376372
dayNames.splice(dayNames.length - 1, 1);
377373
dayNames.unshift(sundayName);

0 commit comments

Comments
 (0)