@websy/websy-designs 1.2.18 → 1.2.20
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.
- package/dist/server/routes/v1/pdf.js +1 -1
- package/dist/websy-designs-es6.debug.js +32 -7
- package/dist/websy-designs-es6.js +220 -193
- package/dist/websy-designs-es6.min.js +1 -1
- package/dist/websy-designs.debug.js +32 -7
- package/dist/websy-designs.js +220 -193
- package/dist/websy-designs.min.js +1 -1
- package/package.json +1 -1
|
@@ -1134,22 +1134,47 @@ class WebsyDatePicker {
|
|
|
1134
1134
|
this.close(confirm)
|
|
1135
1135
|
}
|
|
1136
1136
|
}
|
|
1137
|
-
selectCustomRange (
|
|
1137
|
+
selectCustomRange (rangeInput) {
|
|
1138
1138
|
this.selectedRange = -1
|
|
1139
|
-
|
|
1140
|
-
if (
|
|
1141
|
-
this.
|
|
1142
|
-
|
|
1139
|
+
let isContinuousRange = true
|
|
1140
|
+
if (rangeInput.length === 1) {
|
|
1141
|
+
this.selectedRangeDates = [...rangeInput]
|
|
1142
|
+
this.customRangeSelected = [...rangeInput]
|
|
1143
|
+
}
|
|
1144
|
+
else if (rangeInput.length === 2) {
|
|
1145
|
+
this.selectedRangeDates = [...rangeInput]
|
|
1146
|
+
this.customRangeSelected = [...rangeInput]
|
|
1147
|
+
}
|
|
1148
|
+
rangeInput.forEach((r, i) => {
|
|
1149
|
+
if (i > 0) {
|
|
1150
|
+
if (this.options.mode === 'date' || this.options.mode === 'monthyear') {
|
|
1151
|
+
if ((r.getTime() / this.oneDay) - (rangeInput[i - 1] / this.oneDay) > 1) {
|
|
1152
|
+
isContinuousRange = false
|
|
1153
|
+
}
|
|
1154
|
+
}
|
|
1155
|
+
else if (this.options.mode === 'hour' || this.options.mode === 'year') {
|
|
1156
|
+
if (r - rangeInput[i - 1] > 1) {
|
|
1157
|
+
isContinuousRange = false
|
|
1158
|
+
}
|
|
1159
|
+
}
|
|
1160
|
+
}
|
|
1161
|
+
})
|
|
1162
|
+
if (rangeInput.length > 2 && isContinuousRange === true) {
|
|
1163
|
+
this.selectedRangeDates = [rangeInput[0], rangeInput[rangeInput.length - 1]]
|
|
1164
|
+
}
|
|
1165
|
+
if (isContinuousRange === false) {
|
|
1166
|
+
this.currentselection = []
|
|
1167
|
+
}
|
|
1143
1168
|
// check if the custom range matches a configured range
|
|
1144
1169
|
for (let i = 0; i < this.options.ranges[this.options.mode].length; i++) {
|
|
1145
1170
|
if (this.options.ranges[this.options.mode][i].range.length === 1) {
|
|
1146
|
-
if (this.options.ranges[this.options.mode][i].range[0] ===
|
|
1171
|
+
if (this.options.ranges[this.options.mode][i].range[0] === rangeInput[0]) {
|
|
1147
1172
|
this.selectedRange = i
|
|
1148
1173
|
break
|
|
1149
1174
|
}
|
|
1150
1175
|
}
|
|
1151
1176
|
else if (this.options.ranges[this.options.mode][i].range.length === 2) {
|
|
1152
|
-
if (this.options.ranges[this.options.mode][i].range[0] ===
|
|
1177
|
+
if (this.options.ranges[this.options.mode][i].range[0] === rangeInput[0] && this.options.ranges[this.options.mode][i].range[1] === rangeInput[1]) {
|
|
1153
1178
|
this.selectedRange = i
|
|
1154
1179
|
break
|
|
1155
1180
|
}
|