@olenbetong/appframe-core 2.4.2 → 2.4.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/dist/esm/af.common.js +8 -9
- package/dist/esm/af.common.legacy.js +8 -9
- package/dist/esm/af.common.legacy.min.js +1 -1
- package/dist/esm/af.common.legacy.min.js.map +3 -3
- package/dist/esm/af.common.min.js +1 -1
- package/dist/esm/af.common.min.js.map +3 -3
- package/dist/iife/af.common.js +8 -9
- package/dist/iife/af.common.legacy.js +8 -9
- package/dist/iife/af.common.legacy.min.js +1 -1
- package/dist/iife/af.common.legacy.min.js.map +3 -3
- package/dist/iife/af.common.min.js +1 -1
- package/dist/iife/af.common.min.js.map +3 -3
- package/es/date.d.ts +2 -0
- package/es/date.js +7 -8
- package/es/index.js +1 -1
- package/package.json +50 -50
- package/src/date.ts +15 -10
package/package.json
CHANGED
|
@@ -1,52 +1,52 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
2
|
+
"name": "@olenbetong/appframe-core",
|
|
3
|
+
"version": "2.4.3",
|
|
4
|
+
"description": "Javascript libraries to utilize the Appframe framework",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"sideEffects": [
|
|
7
|
+
"/src/errorHandler.ts"
|
|
8
|
+
],
|
|
9
|
+
"main": "./es/index.js",
|
|
10
|
+
"exports": {
|
|
11
|
+
".": {
|
|
12
|
+
"default": "./es/index.js"
|
|
13
|
+
}
|
|
14
|
+
},
|
|
15
|
+
"types": "./es/index.d.ts",
|
|
16
|
+
"scripts": {
|
|
17
|
+
"prepack": "npm run build",
|
|
18
|
+
"build": "npm run build:esbuild && npm run build:tsc",
|
|
19
|
+
"build:esbuild": "node --loader ts-node/esm.mjs ../../shared/esbuild.ts",
|
|
20
|
+
"build:tsc": " rm -rf ./es && tsc && node ./scripts/replace-version.js"
|
|
21
|
+
},
|
|
22
|
+
"files": [
|
|
23
|
+
"dist",
|
|
24
|
+
"es",
|
|
25
|
+
"src"
|
|
26
|
+
],
|
|
27
|
+
"author": "Bjørnar Vister Hansen <bvh@olenbetong.no>",
|
|
28
|
+
"repository": {
|
|
29
|
+
"type": "git",
|
|
30
|
+
"url": "https://github.com/olenbetong/ui-kit.git"
|
|
31
|
+
},
|
|
32
|
+
"license": "MIT",
|
|
33
|
+
"buildConfig": {
|
|
34
|
+
"entries": [
|
|
35
|
+
{
|
|
36
|
+
"libraryName": "af.common"
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
"libraryName": "af.common",
|
|
40
|
+
"outfile": "af.common.legacy",
|
|
41
|
+
"target": "safari11"
|
|
42
|
+
}
|
|
43
|
+
]
|
|
44
|
+
},
|
|
45
|
+
"dependencies": {
|
|
46
|
+
"mitt": "^3.0.0"
|
|
47
|
+
},
|
|
48
|
+
"devDependencies": {
|
|
49
|
+
"chalk": "^5.1.2"
|
|
50
|
+
},
|
|
51
|
+
"gitHead": "1d17062e6d3a5bee1264d25572ec08ea2635f1ca"
|
|
52
52
|
}
|
package/src/date.ts
CHANGED
|
@@ -1,14 +1,19 @@
|
|
|
1
|
-
export function toLocalISODate(date: Date)
|
|
2
|
-
|
|
1
|
+
export function toLocalISODate(date: Date): string;
|
|
2
|
+
export function toLocalISODate(date: null): null;
|
|
3
|
+
export function toLocalISODate(date: Date | null): string | null {
|
|
4
|
+
return date ? toLocalISODateTime(date).substring(0, 10) : null;
|
|
3
5
|
}
|
|
4
6
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
newDate.setUTCMonth(date.getMonth());
|
|
9
|
-
newDate.setUTCDate(date.getDate());
|
|
10
|
-
newDate.setUTCHours(date.getHours());
|
|
11
|
-
newDate.setUTCMinutes(date.getMinutes());
|
|
7
|
+
function pad(num: number) {
|
|
8
|
+
return String(num).padStart(2, "0");
|
|
9
|
+
}
|
|
12
10
|
|
|
13
|
-
|
|
11
|
+
export function toLocalISODateTime(date: Date): string;
|
|
12
|
+
export function toLocalISODateTime(date: null): null;
|
|
13
|
+
export function toLocalISODateTime(date: Date | null): string | null {
|
|
14
|
+
return date
|
|
15
|
+
? `${date.getFullYear()}-${pad(date.getMonth() + 1)}-${pad(date.getDate())}T${pad(date.getHours())}:${pad(
|
|
16
|
+
date.getMinutes()
|
|
17
|
+
)}:${pad(date.getSeconds())}.${pad(date.getMilliseconds())}`
|
|
18
|
+
: null;
|
|
14
19
|
}
|