@digital-realty/ix-date 1.2.5 → 1.2.13
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 +4 -3
- package/dist/date-utils.d.ts +0 -2
- package/dist/date-utils.js +0 -19
- package/dist/date-utils.js.map +0 -1
package/package.json
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"description": "Webcomponent ix-date following open-wc recommendations",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"author": "Digital Realty",
|
|
6
|
-
"version": "1.2.
|
|
6
|
+
"version": "1.2.13",
|
|
7
7
|
"type": "module",
|
|
8
8
|
"main": "dist/index.js",
|
|
9
9
|
"module": "dist/index.js",
|
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
},
|
|
28
28
|
"dependencies": {
|
|
29
29
|
"@adobe/lit-mobx": "^2.2.2",
|
|
30
|
-
"@digital-realty/ix-field": "^1.2.
|
|
30
|
+
"@digital-realty/ix-field": "^1.2.12",
|
|
31
31
|
"@material/web": "2.4.0",
|
|
32
32
|
"@vaadin/date-picker": "^24.6.0",
|
|
33
33
|
"@web/test-runner-commands": "^0.9.0",
|
|
@@ -111,5 +111,6 @@
|
|
|
111
111
|
"package.json",
|
|
112
112
|
"README.md",
|
|
113
113
|
"LICENSE"
|
|
114
|
-
]
|
|
114
|
+
],
|
|
115
|
+
"gitHead": "b47ba9e880c386ecf579ab21a118f94221cd1e1c"
|
|
115
116
|
}
|
package/dist/date-utils.d.ts
DELETED
package/dist/date-utils.js
DELETED
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import { format } from 'date-fns/format.js';
|
|
2
|
-
import { isValid } from 'date-fns/isValid.js';
|
|
3
|
-
import { parseISO } from 'date-fns/parseISO.js';
|
|
4
|
-
import { toZonedTime } from "date-fns-tz";
|
|
5
|
-
export const formatDate = (date, dateFormat) => {
|
|
6
|
-
const parsedDate = typeof date === 'string' ? parseISO(date) : date;
|
|
7
|
-
const utcDate = toZonedTime(parsedDate, 'UTC'); // Force UTC time zone
|
|
8
|
-
return isValid(utcDate)
|
|
9
|
-
? format(utcDate, dateFormat)
|
|
10
|
-
: '';
|
|
11
|
-
};
|
|
12
|
-
export const formatTime = (date, timeFormat) => {
|
|
13
|
-
const parsedDate = typeof date === 'string' ? parseISO(date) : date;
|
|
14
|
-
const utcDate = toZonedTime(parsedDate, 'UTC'); // Force UTC time zone
|
|
15
|
-
return isValid(utcDate)
|
|
16
|
-
? format(utcDate, timeFormat)
|
|
17
|
-
: '';
|
|
18
|
-
};
|
|
19
|
-
//# sourceMappingURL=date-utils.js.map
|
package/dist/date-utils.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"date-utils.js","sourceRoot":"","sources":["../src/date-utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAC5C,OAAO,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AAC9C,OAAO,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAChD,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAE1C,MAAM,CAAC,MAAM,UAAU,GAAG,CAAC,IAAmB,EAAE,UAAkB,EAAE,EAAE;IACpE,MAAM,UAAU,GAAG,OAAO,IAAI,KAAK,QAAQ,CAAC,CAAC,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC;IACpE,MAAM,OAAO,GAAG,WAAW,CAAC,UAAU,EAAE,KAAK,CAAC,CAAC,CAAC,sBAAsB;IACtE,OAAO,OAAO,CAAC,OAAO,CAAC;QACrB,CAAC,CAAC,MAAM,CAAC,OAAO,EAAE,UAAU,CAAC;QAC7B,CAAC,CAAC,EAAE,CAAC;AAET,CAAC,CAAA;AAED,MAAM,CAAC,MAAM,UAAU,GAAG,CAAC,IAAmB,EAAE,UAAkB,EAAE,EAAE;IACpE,MAAM,UAAU,GAAG,OAAO,IAAI,KAAK,QAAQ,CAAC,CAAC,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC;IACpE,MAAM,OAAO,GAAG,WAAW,CAAC,UAAU,EAAE,KAAK,CAAC,CAAC,CAAC,sBAAsB;IACtE,OAAO,OAAO,CAAC,OAAO,CAAC;QACrB,CAAC,CAAC,MAAM,CAAC,OAAO,EAAE,UAAU,CAAC;QAC7B,CAAC,CAAC,EAAE,CAAC;AACT,CAAC,CAAC","sourcesContent":["import { format } from 'date-fns/format.js';\nimport { isValid } from 'date-fns/isValid.js';\nimport { parseISO } from 'date-fns/parseISO.js';\nimport { toZonedTime } from \"date-fns-tz\";\n\nexport const formatDate = (date: string | Date, dateFormat: string) => {\n const parsedDate = typeof date === 'string' ? parseISO(date) : date;\n const utcDate = toZonedTime(parsedDate, 'UTC'); // Force UTC time zone\n return isValid(utcDate)\n ? format(utcDate, dateFormat)\n : '';\n\n}\n\nexport const formatTime = (date: string | Date, timeFormat: string) => {\n const parsedDate = typeof date === 'string' ? parseISO(date) : date;\n const utcDate = toZonedTime(parsedDate, 'UTC'); // Force UTC time zone\n return isValid(utcDate)\n ? format(utcDate, timeFormat)\n : '';\n};"]}
|