mig-schema-table 3.0.35 → 3.0.36
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -8,6 +8,7 @@ import { SELECT_ALL_COLUMN_NAME, SELECT_ALL_COLUMN_WIDTH } from "./constants";
|
|
|
8
8
|
import Td from "./Td";
|
|
9
9
|
import { DEFAULT_DATE_FORMAT, DEFAULT_DATE_TIME_FORMAT } from "../inc/constant";
|
|
10
10
|
import SchemaColumnFilterPopover from "./SchemaColumnFilterPopover";
|
|
11
|
+
const startOfTheWorldDate = new Date("1000-01-01 00:00:00Z");
|
|
11
12
|
function SchemaTable({ Heading = VariableSizeList, checkedIndexes, disabledCheckedIndexes, config, customElement, data, defaultSortAsc = false, defaultSortColumn, getRowClassName, getRowSelected, maxHeight, isSearchable, isColumnFilterable, isSortable, onCheckedIndexesChange, onRowClick, rowHeight = 36, schema, searchPlaceholder, style, width, }) {
|
|
12
13
|
const [sortColumn, setSortColumn] = React.useState(defaultSortColumn);
|
|
13
14
|
const [sortAsc, setSortAsc] = React.useState(defaultSortAsc);
|
|
@@ -250,11 +251,13 @@ function SchemaTable({ Heading = VariableSizeList, checkedIndexes, disabledCheck
|
|
|
250
251
|
data[b._index][sortColumn]
|
|
251
252
|
: b[sortColumn].toLowerCase();
|
|
252
253
|
if (sortByValue && isDate) {
|
|
253
|
-
|
|
254
|
-
|
|
254
|
+
x = new Date(x);
|
|
255
|
+
if (isNaN(x)) {
|
|
256
|
+
x = startOfTheWorldDate;
|
|
255
257
|
}
|
|
256
|
-
|
|
257
|
-
|
|
258
|
+
y = new Date(y);
|
|
259
|
+
if (isNaN(y)) {
|
|
260
|
+
y = startOfTheWorldDate;
|
|
258
261
|
}
|
|
259
262
|
}
|
|
260
263
|
if (x === y) {
|