@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.
@@ -951,6 +951,7 @@ class WebsyDatePicker {
951
951
  selectCustomRange (range) {
952
952
  this.selectedRange = -1
953
953
  this.selectedRangeDates = range
954
+ this.currentselection = []
954
955
  // check if the custom range matches a configured range
955
956
  for (let i = 0; i < this.options.ranges[this.options.mode].length; i++) {
956
957
  if (this.options.ranges[this.options.mode][i].range.length === 1) {
@@ -1015,18 +1016,22 @@ class WebsyDatePicker {
1015
1016
  })
1016
1017
  let start = list[0]
1017
1018
  let end = ''
1018
- if (this.customRangeSelected === true) {
1019
+ if (this.customRangeSelected === true) {
1019
1020
  end = ` - ${list[list.length - 1]}`
1021
+ if (this.options.mode === 'hour') {
1022
+ end = `${this.customRangeSelected === true ? ' - ' : ''}${this.options.hours[list[list.length - 1]].text}`
1023
+ }
1020
1024
  }
1021
1025
  else {
1022
1026
  if (list.length > 1) {
1023
1027
  start = `${list.length} selected`
1028
+ }
1029
+ else {
1030
+ if (this.options.mode === 'hour') {
1031
+ start = this.options.hours[start].text
1032
+ }
1024
1033
  }
1025
- }
1026
- if (this.options.mode === 'hour') {
1027
- start = this.options.hours[start].text
1028
- end = `${this.customRangeSelected === true ? ' - ' : ''}${this.options.hours[list[list.length - 1]].text}`
1029
- }
1034
+ }
1030
1035
  range = { label: `${start}${end}` }
1031
1036
  }
1032
1037
  else {
@@ -1055,7 +1055,8 @@ var WebsyDatePicker = /*#__PURE__*/function () {
1055
1055
  key: "selectCustomRange",
1056
1056
  value: function selectCustomRange(range) {
1057
1057
  this.selectedRange = -1;
1058
- this.selectedRangeDates = range; // check if the custom range matches a configured range
1058
+ this.selectedRangeDates = range;
1059
+ this.currentselection = []; // check if the custom range matches a configured range
1059
1060
 
1060
1061
  for (var i = 0; i < this.options.ranges[this.options.mode].length; i++) {
1061
1062
  if (this.options.ranges[this.options.mode][i].range.length === 1) {
@@ -1127,17 +1128,20 @@ var WebsyDatePicker = /*#__PURE__*/function () {
1127
1128
 
1128
1129
  if (this.customRangeSelected === true) {
1129
1130
  end = " - ".concat(list[list.length - 1]);
1131
+
1132
+ if (this.options.mode === 'hour') {
1133
+ end = "".concat(this.customRangeSelected === true ? ' - ' : '').concat(this.options.hours[list[list.length - 1]].text);
1134
+ }
1130
1135
  } else {
1131
1136
  if (list.length > 1) {
1132
1137
  start = "".concat(list.length, " selected");
1138
+ } else {
1139
+ if (this.options.mode === 'hour') {
1140
+ start = this.options.hours[start].text;
1141
+ }
1133
1142
  }
1134
1143
  }
1135
1144
 
1136
- if (this.options.mode === 'hour') {
1137
- start = this.options.hours[start].text;
1138
- end = "".concat(this.customRangeSelected === true ? ' - ' : '').concat(this.options.hours[list[list.length - 1]].text);
1139
- }
1140
-
1141
1145
  range = {
1142
1146
  label: "".concat(start).concat(end)
1143
1147
  };