@websy/websy-designs 1.2.17 → 1.2.18
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.
|
@@ -396,7 +396,7 @@ class WebsyDatePicker {
|
|
|
396
396
|
}
|
|
397
397
|
else {
|
|
398
398
|
if (this.options.mode === 'hour') {
|
|
399
|
-
let hoursOut = this.
|
|
399
|
+
let hoursOut = this.currentselection.map(h => this.options.hours[h])
|
|
400
400
|
this.options.onChange(hoursOut, true)
|
|
401
401
|
}
|
|
402
402
|
else {
|
|
@@ -948,10 +948,12 @@ class WebsyDatePicker {
|
|
|
948
948
|
this.close(confirm)
|
|
949
949
|
}
|
|
950
950
|
}
|
|
951
|
-
selectCustomRange (range) {
|
|
951
|
+
selectCustomRange (range, isRange = true) {
|
|
952
952
|
this.selectedRange = -1
|
|
953
953
|
this.selectedRangeDates = range
|
|
954
|
-
|
|
954
|
+
if (isRange === true) {
|
|
955
|
+
this.currentselection = []
|
|
956
|
+
}
|
|
955
957
|
// check if the custom range matches a configured range
|
|
956
958
|
for (let i = 0; i < this.options.ranges[this.options.mode].length; i++) {
|
|
957
959
|
if (this.options.ranges[this.options.mode][i].range.length === 1) {
|
|
@@ -1019,6 +1021,7 @@ class WebsyDatePicker {
|
|
|
1019
1021
|
if (this.customRangeSelected === true) {
|
|
1020
1022
|
end = ` - ${list[list.length - 1]}`
|
|
1021
1023
|
if (this.options.mode === 'hour') {
|
|
1024
|
+
start = this.options.hours[start].text
|
|
1022
1025
|
end = `${this.customRangeSelected === true ? ' - ' : ''}${this.options.hours[list[list.length - 1]].text}`
|
|
1023
1026
|
}
|
|
1024
1027
|
}
|
|
@@ -437,7 +437,7 @@ var WebsyDatePicker = /*#__PURE__*/function () {
|
|
|
437
437
|
}
|
|
438
438
|
} else {
|
|
439
439
|
if (this.options.mode === 'hour') {
|
|
440
|
-
var _hoursOut = this.
|
|
440
|
+
var _hoursOut = this.currentselection.map(function (h) {
|
|
441
441
|
return _this2.options.hours[h];
|
|
442
442
|
});
|
|
443
443
|
|
|
@@ -1054,9 +1054,14 @@ var WebsyDatePicker = /*#__PURE__*/function () {
|
|
|
1054
1054
|
}, {
|
|
1055
1055
|
key: "selectCustomRange",
|
|
1056
1056
|
value: function selectCustomRange(range) {
|
|
1057
|
+
var isRange = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
|
|
1057
1058
|
this.selectedRange = -1;
|
|
1058
1059
|
this.selectedRangeDates = range;
|
|
1059
|
-
|
|
1060
|
+
|
|
1061
|
+
if (isRange === true) {
|
|
1062
|
+
this.currentselection = [];
|
|
1063
|
+
} // check if the custom range matches a configured range
|
|
1064
|
+
|
|
1060
1065
|
|
|
1061
1066
|
for (var i = 0; i < this.options.ranges[this.options.mode].length; i++) {
|
|
1062
1067
|
if (this.options.ranges[this.options.mode][i].range.length === 1) {
|
|
@@ -1130,6 +1135,7 @@ var WebsyDatePicker = /*#__PURE__*/function () {
|
|
|
1130
1135
|
end = " - ".concat(list[list.length - 1]);
|
|
1131
1136
|
|
|
1132
1137
|
if (this.options.mode === 'hour') {
|
|
1138
|
+
start = this.options.hours[start].text;
|
|
1133
1139
|
end = "".concat(this.customRangeSelected === true ? ' - ' : '').concat(this.options.hours[list[list.length - 1]].text);
|
|
1134
1140
|
}
|
|
1135
1141
|
} else {
|