@websy/websy-designs 1.4.35 → 1.4.37

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.
@@ -1153,10 +1153,14 @@ class WebsyDatePicker {
1153
1153
  let start = list[0]
1154
1154
  let end = ''
1155
1155
  if (this.customRangeSelected === true && this.isContinuousRange === true) {
1156
- end = ` - ${list[list.length - 1]}`
1156
+ if (list.length > 1) {
1157
+ end = ` - ${list[list.length - 1]}`
1158
+ }
1157
1159
  if (this.options.mode === 'hour') {
1158
1160
  start = this.options.hours[start].text
1159
- end = `${this.customRangeSelected === true ? ' - ' : ''}${this.options.hours[list[list.length - 1]].text}`
1161
+ if (list.length > 1) {
1162
+ end = `${this.customRangeSelected === true ? ' - ' : ''}${this.options.hours[list[list.length - 1]].text}`
1163
+ }
1160
1164
  }
1161
1165
  }
1162
1166
  else {
@@ -7076,7 +7080,9 @@ else {
7076
7080
  this.longestBottom = this.options.data.bottom.max.toString()
7077
7081
  if (this.options.data.bottom.formatter) {
7078
7082
  this.longestBottom = this.options.data.bottom.formatter(this.options.data.bottom.max).toString()
7079
- firstBottom = this.options.data.bottom.formatter(this.options.data.bottom.data[0].value).toString()
7083
+ if (this.options.data.bottom.data && this.options.data.bottom.data[0] && this.options.data.bottom.data[0].value) {
7084
+ firstBottom = this.options.data.bottom.formatter(this.options.data.bottom.data[0].value).toString()
7085
+ }
7080
7086
  }
7081
7087
  else {
7082
7088
  if (this.options.data.bottom.scale === 'Time') {
@@ -7086,7 +7092,9 @@ else {
7086
7092
  else {
7087
7093
  this.longestBottom = this.options.data.bottom.data.reduce((a, b) => a.length > b.value.length ? a : b.value, '')
7088
7094
  // firstBottom = (this.options.data.bottom.data[0] || [{value: ''}]).value
7089
- firstBottom = this.options.data.bottom.data[0].value
7095
+ if (this.options.data.bottom.data && this.options.data.bottom.data[0] && this.options.data.bottom.data[0].value) {
7096
+ firstBottom = this.options.data.bottom.data[0].value
7097
+ }
7090
7098
  }
7091
7099
  }
7092
7100
  }
@@ -1273,11 +1273,16 @@ var WebsyDatePicker = /*#__PURE__*/function () {
1273
1273
  var end = '';
1274
1274
 
1275
1275
  if (this.customRangeSelected === true && this.isContinuousRange === true) {
1276
- end = " - ".concat(list[list.length - 1]);
1276
+ if (list.length > 1) {
1277
+ end = " - ".concat(list[list.length - 1]);
1278
+ }
1277
1279
 
1278
1280
  if (this.options.mode === 'hour') {
1279
1281
  start = this.options.hours[start].text;
1280
- end = "".concat(this.customRangeSelected === true ? ' - ' : '').concat(this.options.hours[list[list.length - 1]].text);
1282
+
1283
+ if (list.length > 1) {
1284
+ end = "".concat(this.customRangeSelected === true ? ' - ' : '').concat(this.options.hours[list[list.length - 1]].text);
1285
+ }
1281
1286
  }
1282
1287
  } else {
1283
1288
  if (list.length > 1) {
@@ -7788,7 +7793,10 @@ var WebsyChart = /*#__PURE__*/function () {
7788
7793
 
7789
7794
  if (this.options.data.bottom.formatter) {
7790
7795
  this.longestBottom = this.options.data.bottom.formatter(this.options.data.bottom.max).toString();
7791
- firstBottom = this.options.data.bottom.formatter(this.options.data.bottom.data[0].value).toString();
7796
+
7797
+ if (this.options.data.bottom.data && this.options.data.bottom.data[0] && this.options.data.bottom.data[0].value) {
7798
+ firstBottom = this.options.data.bottom.formatter(this.options.data.bottom.data[0].value).toString();
7799
+ }
7792
7800
  } else {
7793
7801
  if (this.options.data.bottom.scale === 'Time') {
7794
7802
  this.longestBottom = '01/01/2000';
@@ -7798,7 +7806,9 @@ var WebsyChart = /*#__PURE__*/function () {
7798
7806
  return a.length > b.value.length ? a : b.value;
7799
7807
  }, ''); // firstBottom = (this.options.data.bottom.data[0] || [{value: ''}]).value
7800
7808
 
7801
- firstBottom = this.options.data.bottom.data[0].value;
7809
+ if (this.options.data.bottom.data && this.options.data.bottom.data[0] && this.options.data.bottom.data[0].value) {
7810
+ firstBottom = this.options.data.bottom.data[0].value;
7811
+ }
7802
7812
  }
7803
7813
  }
7804
7814
  }