@evenicanpm/portal-table-ui 1.8.2 → 1.8.3

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@evenicanpm/portal-table-ui",
3
- "version": "1.8.2",
3
+ "version": "1.8.3",
4
4
  "description": "",
5
5
  "license": "ISC",
6
6
  "author": "",
@@ -47,5 +47,5 @@
47
47
  "@tanstack/react-query": "^5.90.11",
48
48
  "date-fns": "^4.1.0"
49
49
  },
50
- "gitHead": "d82197e04ab3e322c51a112929cec75dd842d5f6"
50
+ "gitHead": "75086d547f588fd7c1832bc23c48c486cc5af588"
51
51
  }
@@ -5,10 +5,28 @@ import type * as Table from "../../../types/";
5
5
  export const dataMaskMap: Table.Handlers.DataMaskMap = {
6
6
  // DATE TIME HAS SPECIFIC MASK HANDLING
7
7
  datetime: (value: string | number, _dataMask: string) => {
8
- return format(new Date(value), "MM/dd/yyyy");
8
+ if (!value) return "";
9
+
10
+ const date = new Date(value);
11
+
12
+ if (isNaN(date.getTime())) {
13
+ console.warn("Invalid datetime value:", value);
14
+ return "";
15
+ }
16
+
17
+ return format(date, "MM/dd/yyyy");
9
18
  },
10
19
  date: (value: string | number, _dataMask: string) => {
11
- return format(new Date(value), "MM/dd/yyyy");
20
+ if (!value) return "";
21
+
22
+ const date = new Date(value);
23
+
24
+ if (isNaN(date.getTime())) {
25
+ console.warn("Invalid date value:", value);
26
+ return "";
27
+ }
28
+
29
+ return format(date, "MM/dd/yyyy");
12
30
  },
13
31
  numeric: (value: string | number, dataMask: string) => {
14
32
  // IS CURRENCY?