Skip to content

Commit 7669ee9

Browse files
committed
Merge branch 'JSterling8-master'
2 parents 160ca8a + 7566b73 commit 7669ee9

File tree

5 files changed

+20
-0
lines changed

5 files changed

+20
-0
lines changed

examples/js/column-filter/all-filters.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,10 @@ function enumFormatter(cell, row, enumObject) {
3636
}
3737

3838
function dateFormatter(cell, row) {
39+
if (typeof cell !== 'object') {
40+
cell = new Date(cell);
41+
}
42+
3943
return `${('0' + cell.getDate()).slice(-2)}/${('0' + (cell.getMonth() + 1)).slice(-2)}/${cell.getFullYear()}`;
4044
}
4145

examples/js/column-filter/date-filter-programmatically.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,10 @@ function addProducts(quantity) {
2323
addProducts(5);
2424

2525
function dateFormatter(cell, row) {
26+
if (typeof cell !== 'object') {
27+
cell = new Date(cell);
28+
}
29+
2630
return `${('0' + cell.getDate()).slice(-2)}/${('0' + (cell.getMonth() + 1)).slice(-2)}/${cell.getFullYear()}`;
2731
}
2832

examples/js/column-filter/date-filter-with-default-value.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,10 @@ function addProducts(quantity) {
2323
addProducts(5);
2424

2525
function dateFormatter(cell, row) {
26+
if (typeof cell !== 'object') {
27+
cell = new Date(cell);
28+
}
29+
2630
return `${('0' + cell.getDate()).slice(-2)}/${('0' + (cell.getMonth() + 1)).slice(-2)}/${cell.getFullYear()}`;
2731
}
2832

examples/js/column-filter/date-filter.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,10 @@ function addProducts(quantity) {
2323
addProducts(5);
2424

2525
function dateFormatter(cell, row) {
26+
if (typeof cell !== 'object') {
27+
cell = new Date(cell);
28+
}
29+
2630
return `${('0' + cell.getDate()).slice(-2)}/${('0' + (cell.getMonth() + 1)).slice(-2)}/${cell.getFullYear()}`;
2731
}
2832

src/store/TableDataStore.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -334,6 +334,10 @@ export class TableDataStore {
334334
const filterMonth = filterVal.getMonth();
335335
const filterYear = filterVal.getFullYear();
336336

337+
if (typeof targetVal !== 'object') {
338+
targetVal = new Date(targetVal);
339+
}
340+
337341
const targetDate = targetVal.getDate();
338342
const targetMonth = targetVal.getMonth();
339343
const targetYear = targetVal.getFullYear();

0 commit comments

Comments
 (0)