mirror of
https://github.com/gosticks/react-bootstrap-table2.git
synced 2025-10-16 11:55:39 +00:00
Merge pull request #440 from react-bootstrap-table/develop
20180730 release
This commit is contained in:
commit
e26065b116
@ -131,7 +131,7 @@ const columns = [..., {
|
||||
Numner filter is same as other filter, you can custom the number filter via `numberFilter` factory function:
|
||||
|
||||
```js
|
||||
import filterFactory, { selectFilter, Comparator } from 'react-bootstrap-table2-filter';
|
||||
import filterFactory, { selectFilter, Comparator, numberFilter } from 'react-bootstrap-table2-filter';
|
||||
// omit...
|
||||
|
||||
const numberFilter = numberFilter({
|
||||
@ -240,4 +240,4 @@ Following properties is valid in `FILTER_TYPES`:
|
||||
* TEXT
|
||||
* SELECT
|
||||
* NUMBER
|
||||
* DATE
|
||||
* DATE
|
||||
|
||||
@ -93,12 +93,16 @@ class DateFilter extends Component {
|
||||
}
|
||||
|
||||
applyFilter(value, comparator) {
|
||||
if (!comparator || !value) {
|
||||
return;
|
||||
}
|
||||
// if (!comparator || !value) {
|
||||
// return;
|
||||
// }
|
||||
const { column, onFilter, delay } = this.props;
|
||||
const execute = () => {
|
||||
const date = typeof value !== 'object' ? new Date(value) : value;
|
||||
// Incoming value should always be a string, and the defaultDate
|
||||
// above is implemented as an empty string, so we can just check for that.
|
||||
// instead of parsing an invalid Date. The filter function will interpret
|
||||
// null as an empty date field
|
||||
const date = value === '' ? null : new Date(value);
|
||||
onFilter(column, FILTER_TYPE.DATE)({ date, comparator });
|
||||
};
|
||||
if (delay) {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user