@websy/websy-designs 1.2.14 → 1.2.15
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -567,9 +567,7 @@ class WebsyDatePicker {
|
|
|
567
567
|
maskEl.classList.remove('active')
|
|
568
568
|
contentEl.classList.remove('active')
|
|
569
569
|
if (confirm === true) {
|
|
570
|
-
if (this.options.onChange) {
|
|
571
|
-
console.log('confirm', this.selectedRangeDates)
|
|
572
|
-
console.log('confirm', this.currentselection)
|
|
570
|
+
if (this.options.onChange) {
|
|
573
571
|
if (this.customRangeSelected === true) {
|
|
574
572
|
if (this.options.mode === 'hour') {
|
|
575
573
|
let hoursOut = []
|
|
@@ -720,9 +718,7 @@ class WebsyDatePicker {
|
|
|
720
718
|
}
|
|
721
719
|
else if (this.options.mode === 'monthyear') {
|
|
722
720
|
let yearDiff = (this.selectedRangeDates[this.selectedRangeDates.length - 1].getFullYear() - this.selectedRangeDates[0].getFullYear()) * 12
|
|
723
|
-
diff = Math.floor((this.selectedRangeDates[this.selectedRangeDates.length - 1].getMonth() - this.selectedRangeDates[0].getMonth())) + yearDiff
|
|
724
|
-
console.log('year diff', yearDiff)
|
|
725
|
-
console.log('diff', diff)
|
|
721
|
+
diff = Math.floor((this.selectedRangeDates[this.selectedRangeDates.length - 1].getMonth() - this.selectedRangeDates[0].getMonth())) + yearDiff
|
|
726
722
|
}
|
|
727
723
|
else if (this.options.mode === 'hour') {
|
|
728
724
|
diff = this.selectedRangeDates[this.selectedRangeDates.length - 1] - this.selectedRangeDates[0]
|
|
@@ -759,10 +755,7 @@ class WebsyDatePicker {
|
|
|
759
755
|
else if (this.options.mode === 'year') {
|
|
760
756
|
dateEl = document.getElementById(`${this.elementId}_${d}_year`)
|
|
761
757
|
}
|
|
762
|
-
else if (this.options.mode === 'monthyear') {
|
|
763
|
-
console.log('d', d)
|
|
764
|
-
console.log(this.selectedRangeDates)
|
|
765
|
-
console.log(rangeStart, rangeEnd)
|
|
758
|
+
else if (this.options.mode === 'monthyear') {
|
|
766
759
|
dateEl = document.getElementById(`${this.elementId}_${d}_monthyear`)
|
|
767
760
|
}
|
|
768
761
|
else if (this.options.mode === 'hour') {
|
|
@@ -1091,8 +1084,7 @@ class WebsyDatePicker {
|
|
|
1091
1084
|
else {
|
|
1092
1085
|
this.currentselection.splice(0, 0, timestamp)
|
|
1093
1086
|
}
|
|
1094
|
-
this.customRangeSelected = true
|
|
1095
|
-
console.log('current selection', this.currentselection)
|
|
1087
|
+
this.customRangeSelected = true
|
|
1096
1088
|
}
|
|
1097
1089
|
else {
|
|
1098
1090
|
let index = this.currentselection.indexOf(timestamp)
|
|
@@ -1107,8 +1099,7 @@ class WebsyDatePicker {
|
|
|
1107
1099
|
}
|
|
1108
1100
|
}
|
|
1109
1101
|
if (this.options.mode === 'date' || this.options.mode === 'monthyear') {
|
|
1110
|
-
this.selectedRangeDates = [new Date(this.currentselection[0]), new Date(this.currentselection[1] || this.currentselection[0])]
|
|
1111
|
-
console.log('selected range', this.selectedRangeDates)
|
|
1102
|
+
this.selectedRangeDates = [new Date(this.currentselection[0]), new Date(this.currentselection[1] || this.currentselection[0])]
|
|
1112
1103
|
}
|
|
1113
1104
|
else if (this.options.mode === 'year') {
|
|
1114
1105
|
this.selectedRangeDates = [this.currentselection[0], this.currentselection[1] || this.currentselection[0]]
|
package/dist/websy-designs.js
CHANGED
|
@@ -635,9 +635,6 @@ var WebsyDatePicker = /*#__PURE__*/function () {
|
|
|
635
635
|
|
|
636
636
|
if (confirm === true) {
|
|
637
637
|
if (this.options.onChange) {
|
|
638
|
-
console.log('confirm', this.selectedRangeDates);
|
|
639
|
-
console.log('confirm', this.currentselection);
|
|
640
|
-
|
|
641
638
|
if (this.customRangeSelected === true) {
|
|
642
639
|
if (this.options.mode === 'hour') {
|
|
643
640
|
var hoursOut = [];
|
|
@@ -810,8 +807,6 @@ var WebsyDatePicker = /*#__PURE__*/function () {
|
|
|
810
807
|
} else if (this.options.mode === 'monthyear') {
|
|
811
808
|
var yearDiff = (this.selectedRangeDates[this.selectedRangeDates.length - 1].getFullYear() - this.selectedRangeDates[0].getFullYear()) * 12;
|
|
812
809
|
diff = Math.floor(this.selectedRangeDates[this.selectedRangeDates.length - 1].getMonth() - this.selectedRangeDates[0].getMonth()) + yearDiff;
|
|
813
|
-
console.log('year diff', yearDiff);
|
|
814
|
-
console.log('diff', diff);
|
|
815
810
|
} else if (this.options.mode === 'hour') {
|
|
816
811
|
diff = this.selectedRangeDates[this.selectedRangeDates.length - 1] - this.selectedRangeDates[0];
|
|
817
812
|
}
|
|
@@ -847,9 +842,6 @@ var WebsyDatePicker = /*#__PURE__*/function () {
|
|
|
847
842
|
} else if (this.options.mode === 'year') {
|
|
848
843
|
dateEl = document.getElementById("".concat(this.elementId, "_").concat(d, "_year"));
|
|
849
844
|
} else if (this.options.mode === 'monthyear') {
|
|
850
|
-
console.log('d', d);
|
|
851
|
-
console.log(this.selectedRangeDates);
|
|
852
|
-
console.log(rangeStart, rangeEnd);
|
|
853
845
|
dateEl = document.getElementById("".concat(this.elementId, "_").concat(d, "_monthyear"));
|
|
854
846
|
} else if (this.options.mode === 'hour') {
|
|
855
847
|
dateEl = document.getElementById("".concat(this.elementId, "_").concat(d, "_hour"));
|
|
@@ -1217,7 +1209,6 @@ var WebsyDatePicker = /*#__PURE__*/function () {
|
|
|
1217
1209
|
}
|
|
1218
1210
|
|
|
1219
1211
|
this.customRangeSelected = true;
|
|
1220
|
-
console.log('current selection', this.currentselection);
|
|
1221
1212
|
} else {
|
|
1222
1213
|
var index = this.currentselection.indexOf(timestamp);
|
|
1223
1214
|
|
|
@@ -1236,7 +1227,6 @@ var WebsyDatePicker = /*#__PURE__*/function () {
|
|
|
1236
1227
|
|
|
1237
1228
|
if (this.options.mode === 'date' || this.options.mode === 'monthyear') {
|
|
1238
1229
|
this.selectedRangeDates = [new Date(this.currentselection[0]), new Date(this.currentselection[1] || this.currentselection[0])];
|
|
1239
|
-
console.log('selected range', this.selectedRangeDates);
|
|
1240
1230
|
} else if (this.options.mode === 'year') {
|
|
1241
1231
|
this.selectedRangeDates = [this.currentselection[0], this.currentselection[1] || this.currentselection[0]];
|
|
1242
1232
|
} else if (this.options.mode === 'monthyear') {//
|