@websy/websy-designs 1.2.15 → 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,16 +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
- start = `${list.length} selected`
1209
- }
1210
- if (this.options.mode === 'hour') {
1211
- start = this.options.hours[start].text
1212
- end = `${this.customRangeSelected === true ? ' - ' : ''}${this.options.hours[list[list.length - 1]].text}`
1213
- }
1212
+ if (list.length > 1) {
1213
+ start = `${list.length} selected`
1214
+ }
1215
+ else {
1216
+ if (this.options.mode === 'hour') {
1217
+ start = this.options.hours[start].text
1218
+ }
1219
+ }
1220
+ }
1214
1221
  range = { label: `${start}${end}` }
1215
1222
  }
1216
1223
  else {
@@ -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; // check if the custom range matches a configured 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,13 +1340,18 @@ var WebsyDatePicker = /*#__PURE__*/function () {
1339
1340
 
1340
1341
  if (this.customRangeSelected === true) {
1341
1342
  end = " - ".concat(list[list.length - 1]);
1342
- } else {
1343
- start = "".concat(list.length, " selected");
1344
- }
1345
1343
 
1346
- if (this.options.mode === 'hour') {
1347
- start = this.options.hours[start].text;
1348
- end = "".concat(this.customRangeSelected === true ? ' - ' : '').concat(this.options.hours[list[list.length - 1]].text);
1344
+ if (this.options.mode === 'hour') {
1345
+ end = "".concat(this.customRangeSelected === true ? ' - ' : '').concat(this.options.hours[list[list.length - 1]].text);
1346
+ }
1347
+ } else {
1348
+ if (list.length > 1) {
1349
+ start = "".concat(list.length, " selected");
1350
+ } else {
1351
+ if (this.options.mode === 'hour') {
1352
+ start = this.options.hours[start].text;
1353
+ }
1354
+ }
1349
1355
  }
1350
1356
 
1351
1357
  range = {