@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.
@@ -582,7 +582,7 @@ class WebsyDatePicker {
582
582
  }
583
583
  else {
584
584
  if (this.options.mode === 'hour') {
585
- let hoursOut = this.selectedRangeDates.map(h => this.options.hours[h])
585
+ let hoursOut = this.currentselection.map(h => this.options.hours[h])
586
586
  this.options.onChange(hoursOut, true)
587
587
  }
588
588
  else {
@@ -1134,10 +1134,12 @@ class WebsyDatePicker {
1134
1134
  this.close(confirm)
1135
1135
  }
1136
1136
  }
1137
- selectCustomRange (range) {
1137
+ selectCustomRange (range, isRange = true) {
1138
1138
  this.selectedRange = -1
1139
1139
  this.selectedRangeDates = range
1140
- this.currentselection = []
1140
+ if (isRange === true) {
1141
+ this.currentselection = []
1142
+ }
1141
1143
  // check if the custom range matches a configured range
1142
1144
  for (let i = 0; i < this.options.ranges[this.options.mode].length; i++) {
1143
1145
  if (this.options.ranges[this.options.mode][i].range.length === 1) {
@@ -1205,6 +1207,7 @@ class WebsyDatePicker {
1205
1207
  if (this.customRangeSelected === true) {
1206
1208
  end = ` - ${list[list.length - 1]}`
1207
1209
  if (this.options.mode === 'hour') {
1210
+ start = this.options.hours[start].text
1208
1211
  end = `${this.customRangeSelected === true ? ' - ' : ''}${this.options.hours[list[list.length - 1]].text}`
1209
1212
  }
1210
1213
  }
@@ -649,7 +649,7 @@ var WebsyDatePicker = /*#__PURE__*/function () {
649
649
  }
650
650
  } else {
651
651
  if (this.options.mode === 'hour') {
652
- var _hoursOut = this.selectedRangeDates.map(function (h) {
652
+ var _hoursOut = this.currentselection.map(function (h) {
653
653
  return _this4.options.hours[h];
654
654
  });
655
655
 
@@ -1266,9 +1266,14 @@ var WebsyDatePicker = /*#__PURE__*/function () {
1266
1266
  }, {
1267
1267
  key: "selectCustomRange",
1268
1268
  value: function selectCustomRange(range) {
1269
+ var isRange = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
1269
1270
  this.selectedRange = -1;
1270
1271
  this.selectedRangeDates = range;
1271
- this.currentselection = []; // check if the custom range matches a configured range
1272
+
1273
+ if (isRange === true) {
1274
+ this.currentselection = [];
1275
+ } // check if the custom range matches a configured range
1276
+
1272
1277
 
1273
1278
  for (var i = 0; i < this.options.ranges[this.options.mode].length; i++) {
1274
1279
  if (this.options.ranges[this.options.mode][i].range.length === 1) {
@@ -1342,6 +1347,7 @@ var WebsyDatePicker = /*#__PURE__*/function () {
1342
1347
  end = " - ".concat(list[list.length - 1]);
1343
1348
 
1344
1349
  if (this.options.mode === 'hour') {
1350
+ start = this.options.hours[start].text;
1345
1351
  end = "".concat(this.customRangeSelected === true ? ' - ' : '').concat(this.options.hours[list[list.length - 1]].text);
1346
1352
  }
1347
1353
  } else {