@websy/websy-designs 1.2.16 → 1.2.17
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.
|
@@ -1137,6 +1137,7 @@ class WebsyDatePicker {
|
|
|
1137
1137
|
selectCustomRange (range) {
|
|
1138
1138
|
this.selectedRange = -1
|
|
1139
1139
|
this.selectedRangeDates = range
|
|
1140
|
+
this.currentselection = []
|
|
1140
1141
|
// check if the custom range matches a configured range
|
|
1141
1142
|
for (let i = 0; i < this.options.ranges[this.options.mode].length; i++) {
|
|
1142
1143
|
if (this.options.ranges[this.options.mode][i].range.length === 1) {
|
|
@@ -1201,18 +1202,22 @@ class WebsyDatePicker {
|
|
|
1201
1202
|
})
|
|
1202
1203
|
let start = list[0]
|
|
1203
1204
|
let end = ''
|
|
1204
|
-
if (this.customRangeSelected === true) {
|
|
1205
|
+
if (this.customRangeSelected === true) {
|
|
1205
1206
|
end = ` - ${list[list.length - 1]}`
|
|
1207
|
+
if (this.options.mode === 'hour') {
|
|
1208
|
+
end = `${this.customRangeSelected === true ? ' - ' : ''}${this.options.hours[list[list.length - 1]].text}`
|
|
1209
|
+
}
|
|
1206
1210
|
}
|
|
1207
1211
|
else {
|
|
1208
1212
|
if (list.length > 1) {
|
|
1209
1213
|
start = `${list.length} selected`
|
|
1214
|
+
}
|
|
1215
|
+
else {
|
|
1216
|
+
if (this.options.mode === 'hour') {
|
|
1217
|
+
start = this.options.hours[start].text
|
|
1218
|
+
}
|
|
1210
1219
|
}
|
|
1211
|
-
}
|
|
1212
|
-
if (this.options.mode === 'hour') {
|
|
1213
|
-
start = this.options.hours[start].text
|
|
1214
|
-
end = `${this.customRangeSelected === true ? ' - ' : ''}${this.options.hours[list[list.length - 1]].text}`
|
|
1215
|
-
}
|
|
1220
|
+
}
|
|
1216
1221
|
range = { label: `${start}${end}` }
|
|
1217
1222
|
}
|
|
1218
1223
|
else {
|
package/dist/websy-designs.js
CHANGED
|
@@ -1267,7 +1267,8 @@ var WebsyDatePicker = /*#__PURE__*/function () {
|
|
|
1267
1267
|
key: "selectCustomRange",
|
|
1268
1268
|
value: function selectCustomRange(range) {
|
|
1269
1269
|
this.selectedRange = -1;
|
|
1270
|
-
this.selectedRangeDates = range;
|
|
1270
|
+
this.selectedRangeDates = range;
|
|
1271
|
+
this.currentselection = []; // check if the custom range matches a configured range
|
|
1271
1272
|
|
|
1272
1273
|
for (var i = 0; i < this.options.ranges[this.options.mode].length; i++) {
|
|
1273
1274
|
if (this.options.ranges[this.options.mode][i].range.length === 1) {
|
|
@@ -1339,17 +1340,20 @@ var WebsyDatePicker = /*#__PURE__*/function () {
|
|
|
1339
1340
|
|
|
1340
1341
|
if (this.customRangeSelected === true) {
|
|
1341
1342
|
end = " - ".concat(list[list.length - 1]);
|
|
1343
|
+
|
|
1344
|
+
if (this.options.mode === 'hour') {
|
|
1345
|
+
end = "".concat(this.customRangeSelected === true ? ' - ' : '').concat(this.options.hours[list[list.length - 1]].text);
|
|
1346
|
+
}
|
|
1342
1347
|
} else {
|
|
1343
1348
|
if (list.length > 1) {
|
|
1344
1349
|
start = "".concat(list.length, " selected");
|
|
1350
|
+
} else {
|
|
1351
|
+
if (this.options.mode === 'hour') {
|
|
1352
|
+
start = this.options.hours[start].text;
|
|
1353
|
+
}
|
|
1345
1354
|
}
|
|
1346
1355
|
}
|
|
1347
1356
|
|
|
1348
|
-
if (this.options.mode === 'hour') {
|
|
1349
|
-
start = this.options.hours[start].text;
|
|
1350
|
-
end = "".concat(this.customRangeSelected === true ? ' - ' : '').concat(this.options.hours[list[list.length - 1]].text);
|
|
1351
|
-
}
|
|
1352
|
-
|
|
1353
1357
|
range = {
|
|
1354
1358
|
label: "".concat(start).concat(end)
|
|
1355
1359
|
};
|