Skip to content

Commit 64c50c9

Browse files
committed
Fixed that date can be cleared
1 parent d421fe8 commit 64c50c9

File tree

7 files changed

+28
-52
lines changed

7 files changed

+28
-52
lines changed

public/js/dist/filterFormManager.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import {
44
AssignedEntityFilterInput,
55
DateFilterInput,
66
TextFilterInput
7-
} from '/js/dist/filterInputs.js';
7+
} from '/js/dist/filterInputs.min.js';
88
import { container } from '/js/dist/simpleDIContainer.min.js';
99

1010
export default class FilterFormManager {
@@ -61,9 +61,7 @@ export default class FilterFormManager {
6161
clearAll() {
6262
//this.collectFilterData();
6363
this.inputs.forEach(field => {
64-
queueMicrotask(() => {
6564
field.clear();
66-
})
6765
});
6866
}
6967

public/js/dist/filterFormManager.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

public/js/dist/filterInputs.js

Lines changed: 10 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -325,32 +325,22 @@ class DateFilterInput extends FilterInput {
325325
return result;
326326
}
327327

328-
/*setValue() {
329-
$(this.container).datepicker('setStartDate', '2020-01-01');
330-
//console.error("Currently not implemented");
331-
//throw new Error("Currently not implemented");
332-
//return this.hasValue() ? this.element.value : null;
333-
}*/
334-
335328
setValue(newValue, logic, operator) {
336329

337330
return new Promise((resolve, reject) => {
338331
try {
339332

340333
if (newValue.startDate != undefined) {
341334
const startDateObject = new Date(newValue.startDate);
342-
console.log("start", newValue.startDate, startDateObject);
343335
this.startDatepicker.datepicker('setDate', startDateObject);
344336
}
345337

346338
if (newValue.endDate != undefined) {
347339
const endDateObject = new Date(newValue.endDate);
348-
console.log("end", newValue.endDate, endDateObject);
349340
this.endDatepicker.datepicker('setDate', endDateObject);
350341
}
351342

352343
this.setSearchOperator(logic, operator);
353-
console.log("this.getvalues", this.getValue());
354344
resolve(newValue);
355345
}
356346
catch (e) {
@@ -361,16 +351,16 @@ class DateFilterInput extends FilterInput {
361351
}
362352

363353
clear() {
364-
/*const r = this.getValue();
365-
if (r.startDate !== undefined || r.endDate !== undefined) {
366-
// I don't know why this is needed but without it won't reset properly
367-
$(this.container).datepicker('setDates', ['2000-01-01', '2000-01-02']);
368-
$(this.container).datepicker('clearDates');
369-
}*/
370-
//this.startDatepicker.datepicker('clearDates');
371-
//this.endDatepicker.datepicker('clearDates');
372-
this.startDate = undefined;
373-
this.endDate = undefined;
354+
const r = this.getValue();
355+
console.log("r", r);
356+
if (r.startDate !== undefined || jQuery.isEmptyObject(r) === false) {
357+
this.startDatepicker.datepicker('clearDates');
358+
this.startDate = undefined;
359+
}
360+
if (r.endDate !== undefined || jQuery.isEmptyObject(r) === false) {
361+
this.endDatepicker.datepicker('clearDates');
362+
this.endDate = undefined;
363+
}
374364

375365
super.clear();
376366
}

public/js/dist/filterInputs.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

public/mix-manifest.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,10 +36,10 @@
3636
"/js/dist/floating-buttons.min.js": "/js/dist/floating-buttons.min.js?id=bef97dca53c8ad4bda54f1009628a121",
3737
"/js/dist/apiService.js": "/js/dist/apiService.js?id=4e838fdc8aaf6a0de54c69b1b84f9669",
3838
"/js/dist/apiService.min.js": "/js/dist/apiService.min.js?id=4e838fdc8aaf6a0de54c69b1b84f9669",
39-
"/js/dist/filterInputs.js": "/js/dist/filterInputs.js?id=933ea8e03c23d15bdd3a59fa738e4cd4",
40-
"/js/dist/filterInputs.min.js": "/js/dist/filterInputs.min.js?id=933ea8e03c23d15bdd3a59fa738e4cd4",
41-
"/js/dist/filterFormManager.js": "/js/dist/filterFormManager.js?id=3da42798a17a2a3c0f73033238fc5b12",
42-
"/js/dist/filterFormManager.min.js": "/js/dist/filterFormManager.min.js?id=3da42798a17a2a3c0f73033238fc5b12",
39+
"/js/dist/filterInputs.js": "/js/dist/filterInputs.js?id=06b3104923015d3457ef67eae0185494",
40+
"/js/dist/filterInputs.min.js": "/js/dist/filterInputs.min.js?id=06b3104923015d3457ef67eae0185494",
41+
"/js/dist/filterFormManager.js": "/js/dist/filterFormManager.js?id=b33f0f7fe668173f6a04964b3cb2c2f2",
42+
"/js/dist/filterFormManager.min.js": "/js/dist/filterFormManager.min.js?id=b33f0f7fe668173f6a04964b3cb2c2f2",
4343
"/js/select2/i18n/af.js": "/js/select2/i18n/af.js?id=4f6fcd73488ce79fae1b7a90aceaecde",
4444
"/js/select2/i18n/ar.js": "/js/select2/i18n/ar.js?id=65aa8e36bf5da57ff4e3f22a835ab035",
4545
"/js/select2/i18n/az.js": "/js/select2/i18n/az.js?id=270c257daf8140a0cf23ad5de6f8ed1b",

resources/assets/js/advancedSearch/filterFormManager.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import {
44
AssignedEntityFilterInput,
55
DateFilterInput,
66
TextFilterInput
7-
} from '/js/dist/filterInputs.js';
7+
} from '/js/dist/filterInputs.min.js';
88
import { container } from '/js/dist/simpleDIContainer.min.js';
99

1010
export default class FilterFormManager {
@@ -61,9 +61,7 @@ export default class FilterFormManager {
6161
clearAll() {
6262
//this.collectFilterData();
6363
this.inputs.forEach(field => {
64-
queueMicrotask(() => {
6564
field.clear();
66-
})
6765
});
6866
}
6967

0 commit comments

Comments
 (0)