@insticc/react-datagrid-2 1.0.27 → 1.0.28
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.
- package/build/wrapper/index.js +7 -0
- package/package.json +1 -1
package/build/wrapper/index.js
CHANGED
|
@@ -195,6 +195,13 @@ var DataGrid = function DataGrid(_ref) {
|
|
|
195
195
|
enableClickToCopy: (_column$enableClickTo = column.enableClickToCopy) !== null && _column$enableClickTo !== void 0 ? _column$enableClickTo : false,
|
|
196
196
|
enableColumnActions: (_column$enableColumnA = column.enableColumnActions) !== null && _column$enableColumnA !== void 0 ? _column$enableColumnA : false,
|
|
197
197
|
// sortingFn: --> basic default, datetime for date
|
|
198
|
+
sortingFn: column.isDateColumn ? function (rowA, rowB, columnId) {
|
|
199
|
+
var dateA = rowA.getValue(columnId) ? new Date(rowA.getValue(columnId)).getTime() : null;
|
|
200
|
+
var dateB = rowB.getValue(columnId) ? new Date(rowB.getValue(columnId)).getTime() : null;
|
|
201
|
+
if (dateA === null) return 1;
|
|
202
|
+
if (dateB === null) return -1;
|
|
203
|
+
return dateA - dateB; // Sort by timestamp
|
|
204
|
+
} : 'basic',
|
|
198
205
|
Cell: function Cell(props) {
|
|
199
206
|
return column.cellClass ? /*#__PURE__*/_react["default"].createElement("div", {
|
|
200
207
|
className: column.cellClass
|