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 d5d8c54

Browse files
fix React doesn't allow Date Object as children
1 parent 2ec55f6 commit d5d8c54

File tree

5 files changed

+5
-1
lines changed

5 files changed

+5
-1
lines changed

‎packages/react-bootstrap-table2-example/examples/column-filter/custom-date-filter.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ const columns = [{
1515
}, {
1616
dataField: 'inStockDate',
1717
text: 'InStock Date',
18+
formatter: cell => cell.toString(),
1819
filter: dateFilter({
1920
delay: 400,
2021
placeholder: 'custom placeholder',

‎packages/react-bootstrap-table2-example/examples/column-filter/date-filter-default-value.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ const columns = [{
1515
}, {
1616
dataField: 'inStockDate',
1717
text: 'InStock Date',
18+
formatter: cell => cell.toString(),
1819
filter: dateFilter({
1920
defaultValue: { date: new Date(2018, 0, 1), comparator: Comparator.GT }
2021
})

‎packages/react-bootstrap-table2-example/examples/column-filter/date-filter.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ const columns = [{
1515
}, {
1616
dataField: 'inStockDate',
1717
text: 'InStock Date',
18+
formatter: cell => cell.toString(),
1819
filter: dateFilter()
1920
}];
2021

‎packages/react-bootstrap-table2-example/examples/column-filter/programmatically-date-filter.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ const columns = [{
1717
}, {
1818
dataField: 'inStockDate',
1919
text: 'InStock Date',
20+
formatter: cell => cell.toString(),
2021
filter: dateFilter({
2122
getFilter: (filter) => {
2223
// inStockDateFilter was assigned once the component has been mounted.

‎packages/react-bootstrap-table2-filter/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -214,7 +214,7 @@ const columns = [..., {
214214
<BootstrapTable keyField='id' data={ products } columns={ columns } filter={ filterFactory() } />
215215
```
216216

217-
> **Notes:** date filter accept a Javascript Date object in your raw data.
217+
> **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
218218
219219
Date filter is same as other filter, you can custom the date filter via `dateFilter` factory function:
220220

0 commit comments

Comments
(0)

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