Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 2ec55f6

Browse files
patch for default sort and filter have potential issue when remote
1 parent f7406bc commit 2ec55f6

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

‎packages/react-bootstrap-table2-filter/src/components/date.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ class DateFilter extends Component {
9292
return defaultDate;
9393
}
9494

95-
applyFilter(value, comparator) {
95+
applyFilter(value, comparator,isInitial) {
9696
// if (!comparator || !value) {
9797
// return;
9898
// }
@@ -103,7 +103,7 @@ class DateFilter extends Component {
103103
// instead of parsing an invalid Date. The filter function will interpret
104104
// null as an empty date field
105105
const date = value === '' ? null : new Date(value);
106-
onFilter(column, FILTER_TYPE.DATE, )({ date, comparator });
106+
onFilter(column, FILTER_TYPE.DATE, isInitial)({ date, comparator });
107107
};
108108
if (delay) {
109109
this.timeout = setTimeout(() => { execute(); }, delay);

‎packages/react-bootstrap-table2-filter/test/components/date.test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ describe('Date Filter', () => {
124124

125125
it('should do onFilter correctly when exported function was executed', () => {
126126
expect(onFilter).toHaveBeenCalledTimes(1);
127-
expect(onFilter).toHaveBeenCalledWith(column, FILTER_TYPE.DATE, false);
127+
expect(onFilter).toHaveBeenCalledWith(column, FILTER_TYPE.DATE, undefined);
128128
expect(onFilterFirstReturn).toHaveBeenCalledTimes(1);
129129
expect(onFilterFirstReturn).toHaveBeenCalledWith({ comparator, date });
130130
});

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /