@websy/websy-designs 1.4.10 → 1.4.12

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.
@@ -692,11 +692,13 @@ class WebsyDatePicker {
692
692
  this.close()
693
693
  }
694
694
  else if (event.target.classList.contains('clear-selection')) {
695
+ this.currentselection = []
696
+ this.selectedRangeDates = []
695
697
  this.selectRange(0, false)
696
698
  if (this.options.onClear) {
697
699
  this.options.onClear()
698
700
  }
699
- this.updateRange(0)
701
+ // this.updateRange(0)
700
702
  }
701
703
  }
702
704
  handleKeyDown (event) {
@@ -1215,18 +1217,21 @@ class WebsyDatePicker {
1215
1217
  selectRange (index, confirm = true) {
1216
1218
  if (this.options.ranges[this.options.mode][index]) {
1217
1219
  this.selectedRangeDates = [...this.options.ranges[this.options.mode][index].range]
1218
- this.currentselection = this.options.ranges[this.options.mode][index].range.map(d => {
1219
- if (this.options.mode === 'date' || this.options.mode === 'monthyear') {
1220
- return d.getTime()
1221
- }
1222
- else {
1223
- return d
1224
- }
1225
- })
1220
+ this.currentselection = []
1221
+ // this.currentselection = this.options.ranges[this.options.mode][index].range.map(d => {
1222
+ // if (this.options.mode === 'date' || this.options.mode === 'monthyear') {
1223
+ // return d.getTime()
1224
+ // }
1225
+ // else {
1226
+ // return d
1227
+ // }
1228
+ // })
1226
1229
  this.selectedRange = +index
1227
1230
  this.highlightRange()
1228
- this.updateRange()
1229
- this.close(confirm, true)
1231
+ this.updateRange()
1232
+ if (confirm === true) {
1233
+ this.close(confirm, true)
1234
+ }
1230
1235
  }
1231
1236
  }
1232
1237
  selectCustomRange (rangeInput) {