@trackunit/iris-app-runtime-core 0.3.181 → 0.3.183

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/index.cjs.js CHANGED
@@ -253,11 +253,13 @@ const getStringValue = (value) => {
253
253
  * yyyy-mm-dd
254
254
  */
255
255
  const getDateValue = (value) => {
256
- const date = new Date(value);
257
- const day = date.toLocaleString("en-US", { day: "2-digit" });
258
- const month = date.toLocaleString("en-US", { month: "2-digit" });
259
- const year = date.toLocaleString("en-US", { year: "numeric" });
260
- return `${year}-${month}-${day}`;
256
+ // remove timezone to ensure the date is always the same
257
+ const date = new Date(value.substring(0, 10));
258
+ const dateFormatted = date.toISOString().split("T");
259
+ if (dateFormatted.length !== 2) {
260
+ return undefined;
261
+ }
262
+ return dateFormatted[0];
261
263
  };
262
264
  /**
263
265
  * Format a custom field value to ensure a consistent representation in the ui.
package/index.esm.js CHANGED
@@ -249,11 +249,13 @@ const getStringValue = (value) => {
249
249
  * yyyy-mm-dd
250
250
  */
251
251
  const getDateValue = (value) => {
252
- const date = new Date(value);
253
- const day = date.toLocaleString("en-US", { day: "2-digit" });
254
- const month = date.toLocaleString("en-US", { month: "2-digit" });
255
- const year = date.toLocaleString("en-US", { year: "numeric" });
256
- return `${year}-${month}-${day}`;
252
+ // remove timezone to ensure the date is always the same
253
+ const date = new Date(value.substring(0, 10));
254
+ const dateFormatted = date.toISOString().split("T");
255
+ if (dateFormatted.length !== 2) {
256
+ return undefined;
257
+ }
258
+ return dateFormatted[0];
257
259
  };
258
260
  /**
259
261
  * Format a custom field value to ensure a consistent representation in the ui.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@trackunit/iris-app-runtime-core",
3
- "version": "0.3.181",
3
+ "version": "0.3.183",
4
4
  "repository": "https://github.com/Trackunit/manager",
5
5
  "license": "SEE LICENSE IN LICENSE.txt",
6
6
  "engines": {
@@ -24,7 +24,7 @@ export declare const getStringValue: (value: boolean | string | string[] | Dropd
24
24
  * Format the received value to a date string
25
25
  * yyyy-mm-dd
26
26
  */
27
- export declare const getDateValue: (value: string) => string;
27
+ export declare const getDateValue: (value: string) => string | undefined;
28
28
  /**
29
29
  * Format a custom field value to ensure a consistent representation in the ui.
30
30
  */