mirror of
https://github.com/gosticks/react-bootstrap-table2.git
synced 2026-06-29 13:40:07 +00:00
Compare commits
5 Commits
react-boot
...
react-boot
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
7d7688582b | ||
|
|
e26065b116 | ||
|
|
6522f6d964 | ||
|
|
ecaf439e66 | ||
|
|
90d03676ad |
@@ -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
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "react-bootstrap-table2-filter",
|
||||
"version": "0.3.0",
|
||||
"version": "0.3.1",
|
||||
"description": "it's a column filter addon for react-bootstrap-table2",
|
||||
"main": "./lib/index.js",
|
||||
"repository": {
|
||||
|
||||
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user