mirror of
https://github.com/gosticks/react-bootstrap-table2.git
synced 2026-07-01 14:40:02 +00:00
fix React doesn't allow Date Object as children
This commit is contained in:
@@ -15,6 +15,7 @@ const columns = [{
|
||||
}, {
|
||||
dataField: 'inStockDate',
|
||||
text: 'InStock Date',
|
||||
formatter: cell => cell.toString(),
|
||||
filter: dateFilter({
|
||||
delay: 400,
|
||||
placeholder: 'custom placeholder',
|
||||
|
||||
@@ -15,6 +15,7 @@ const columns = [{
|
||||
}, {
|
||||
dataField: 'inStockDate',
|
||||
text: 'InStock Date',
|
||||
formatter: cell => cell.toString(),
|
||||
filter: dateFilter({
|
||||
defaultValue: { date: new Date(2018, 0, 1), comparator: Comparator.GT }
|
||||
})
|
||||
|
||||
@@ -15,6 +15,7 @@ const columns = [{
|
||||
}, {
|
||||
dataField: 'inStockDate',
|
||||
text: 'InStock Date',
|
||||
formatter: cell => cell.toString(),
|
||||
filter: dateFilter()
|
||||
}];
|
||||
|
||||
|
||||
@@ -17,6 +17,7 @@ const columns = [{
|
||||
}, {
|
||||
dataField: 'inStockDate',
|
||||
text: 'InStock Date',
|
||||
formatter: cell => cell.toString(),
|
||||
filter: dateFilter({
|
||||
getFilter: (filter) => {
|
||||
// inStockDateFilter was assigned once the component has been mounted.
|
||||
|
||||
@@ -214,7 +214,7 @@ const columns = [..., {
|
||||
<BootstrapTable keyField='id' data={ products } columns={ columns } filter={ filterFactory() } />
|
||||
```
|
||||
|
||||
> **Notes:** date filter accept a Javascript Date object in your raw data.
|
||||
> **Notes:** date filter accept a Javascript Date object in your raw data and you have to use `column.formatter` to make it as your prefer string result
|
||||
|
||||
Date filter is same as other filter, you can custom the date filter via `dateFilter` factory function:
|
||||
|
||||
|
||||
Reference in New Issue
Block a user