date-vir 0.2.2 → 0.2.4
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/cjs/full-date/primitive-conversions.js +6 -6
- package/dist/{full-date → esm/full-date}/primitive-conversions.js +6 -6
- package/package.json +7 -6
- /package/dist/{full-date → esm/full-date}/calculate-relative-date.d.ts +0 -0
- /package/dist/{full-date → esm/full-date}/calculate-relative-date.js +0 -0
- /package/dist/{full-date → esm/full-date}/combine-dates.d.ts +0 -0
- /package/dist/{full-date → esm/full-date}/combine-dates.js +0 -0
- /package/dist/{full-date → esm/full-date}/create-full-date.d.ts +0 -0
- /package/dist/{full-date → esm/full-date}/create-full-date.js +0 -0
- /package/dist/{full-date → esm/full-date}/date-like.d.ts +0 -0
- /package/dist/{full-date → esm/full-date}/date-like.js +0 -0
- /package/dist/{full-date → esm/full-date}/format-presets.d.ts +0 -0
- /package/dist/{full-date → esm/full-date}/format-presets.js +0 -0
- /package/dist/{full-date → esm/full-date}/full-date-shape.d.ts +0 -0
- /package/dist/{full-date → esm/full-date}/full-date-shape.js +0 -0
- /package/dist/{full-date → esm/full-date}/is-valid-full-date.d.ts +0 -0
- /package/dist/{full-date → esm/full-date}/is-valid-full-date.js +0 -0
- /package/dist/{full-date → esm/full-date}/luxon-date-time-conversion.d.ts +0 -0
- /package/dist/{full-date → esm/full-date}/luxon-date-time-conversion.js +0 -0
- /package/dist/{full-date → esm/full-date}/parsing.d.ts +0 -0
- /package/dist/{full-date → esm/full-date}/parsing.js +0 -0
- /package/dist/{full-date → esm/full-date}/primitive-conversions.d.ts +0 -0
- /package/dist/{full-date → esm/full-date}/string-format-types.d.ts +0 -0
- /package/dist/{full-date → esm/full-date}/string-format-types.js +0 -0
- /package/dist/{index.d.ts → esm/index.d.ts} +0 -0
- /package/dist/{index.js → esm/index.js} +0 -0
- /package/dist/{locales.d.ts → esm/locales.d.ts} +0 -0
- /package/dist/{locales.js → esm/locales.js} +0 -0
- /package/dist/{timezone → esm/timezone}/timezone-checks.d.ts +0 -0
- /package/dist/{timezone → esm/timezone}/timezone-checks.js +0 -0
- /package/dist/{timezone → esm/timezone}/timezone-names.d.ts +0 -0
- /package/dist/{timezone → esm/timezone}/timezone-names.js +0 -0
- /package/dist/{timezone → esm/timezone}/timezones.d.ts +0 -0
- /package/dist/{timezone → esm/timezone}/timezones.js +0 -0
|
@@ -54,9 +54,9 @@ function toHtmlInputString(fullDate, inputType, includeSeconds) {
|
|
|
54
54
|
throw new Error(`Tried to create date string but no day was provided.`);
|
|
55
55
|
}
|
|
56
56
|
const dateParts = [
|
|
57
|
-
fullDate.year,
|
|
58
|
-
String(fullDate.month).padStart(2, '0'),
|
|
59
|
-
String(fullDate.day).padStart(2, '0'),
|
|
57
|
+
String(Math.abs(fullDate.year)).padStart(4, '0'),
|
|
58
|
+
String(Math.abs(fullDate.month)).padStart(2, '0'),
|
|
59
|
+
String(Math.abs(fullDate.day)).padStart(2, '0'),
|
|
60
60
|
];
|
|
61
61
|
return dateParts.join('-');
|
|
62
62
|
}
|
|
@@ -71,9 +71,9 @@ function toHtmlInputString(fullDate, inputType, includeSeconds) {
|
|
|
71
71
|
throw new Error(`Tried to create time string but no minutes were provided.`);
|
|
72
72
|
}
|
|
73
73
|
const timeParts = [
|
|
74
|
-
String(fullDate.hour).padStart(2, '0'),
|
|
75
|
-
String(fullDate.minute).padStart(2, '0'),
|
|
76
|
-
includeSeconds ? String(fullDate.second).padStart(2, '0') : undefined,
|
|
74
|
+
String(Math.abs(fullDate.hour)).padStart(2, '0'),
|
|
75
|
+
String(Math.abs(fullDate.minute)).padStart(2, '0'),
|
|
76
|
+
includeSeconds ? String(Math.abs(fullDate.second ?? 0)).padStart(2, '0') : undefined,
|
|
77
77
|
].filter((entry) => entry != undefined);
|
|
78
78
|
return timeParts.join(':');
|
|
79
79
|
}
|
|
@@ -54,9 +54,9 @@ function toHtmlInputString(fullDate, inputType, includeSeconds) {
|
|
|
54
54
|
throw new Error(`Tried to create date string but no day was provided.`);
|
|
55
55
|
}
|
|
56
56
|
const dateParts = [
|
|
57
|
-
fullDate.year,
|
|
58
|
-
String(fullDate.month).padStart(2, '0'),
|
|
59
|
-
String(fullDate.day).padStart(2, '0'),
|
|
57
|
+
String(Math.abs(fullDate.year)).padStart(4, '0'),
|
|
58
|
+
String(Math.abs(fullDate.month)).padStart(2, '0'),
|
|
59
|
+
String(Math.abs(fullDate.day)).padStart(2, '0'),
|
|
60
60
|
];
|
|
61
61
|
return dateParts.join('-');
|
|
62
62
|
}
|
|
@@ -71,9 +71,9 @@ function toHtmlInputString(fullDate, inputType, includeSeconds) {
|
|
|
71
71
|
throw new Error(`Tried to create time string but no minutes were provided.`);
|
|
72
72
|
}
|
|
73
73
|
const timeParts = [
|
|
74
|
-
String(fullDate.hour).padStart(2, '0'),
|
|
75
|
-
String(fullDate.minute).padStart(2, '0'),
|
|
76
|
-
includeSeconds ? String(fullDate.second).padStart(2, '0') : undefined,
|
|
74
|
+
String(Math.abs(fullDate.hour)).padStart(2, '0'),
|
|
75
|
+
String(Math.abs(fullDate.minute)).padStart(2, '0'),
|
|
76
|
+
includeSeconds ? String(Math.abs(fullDate.second ?? 0)).padStart(2, '0') : undefined,
|
|
77
77
|
].filter((entry) => entry != undefined);
|
|
78
78
|
return timeParts.join(':');
|
|
79
79
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "date-vir",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.4",
|
|
4
4
|
"description": "Easy and explicit dates and times",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"date",
|
|
@@ -20,11 +20,12 @@
|
|
|
20
20
|
"name": "electrovir",
|
|
21
21
|
"url": "https://github.com/electrovir"
|
|
22
22
|
},
|
|
23
|
-
"main": "dist/index.js",
|
|
24
|
-
"
|
|
23
|
+
"main": "dist/cjs/index.js",
|
|
24
|
+
"module": "dist/esm/index.js",
|
|
25
|
+
"types": "dist/esm/index.d.ts",
|
|
25
26
|
"scripts": {
|
|
26
|
-
"compile": "tsc --project tsconfig.json
|
|
27
|
-
"docs:update": "virmator code-in-markdown",
|
|
27
|
+
"compile": "rm -rf dist && concurrently --colors --kill-others-on-fail -c auto --names esm,cjs \"tsc --project tsconfig.json\" \"tsc --project tsconfig.cjs.json\"",
|
|
28
|
+
"docs:update": "virmator code-in-markdown --index src/index.ts README.md",
|
|
28
29
|
"format": "virmator format",
|
|
29
30
|
"publish": "virmator publish \"npm run compile && npm run test:all\"",
|
|
30
31
|
"start": "npm install && virmator frontend",
|
|
@@ -32,7 +33,7 @@
|
|
|
32
33
|
"test:all": "concurrently --colors --kill-others-on-fail -c auto --names types,tests,spelling,format,docs \"npm run test:types\" \"npm run test:coverage\" \"npm run test:spelling\" \"npm run test:format\" \"npm run test:docs\"",
|
|
33
34
|
"test:coverage": "npm run test coverage",
|
|
34
35
|
"test:debug": "web-test-runner --watch --color --config configs/web-test-runner.config.mjs --only-one-browser",
|
|
35
|
-
"test:docs": "virmator code-in-markdown check",
|
|
36
|
+
"test:docs": "virmator code-in-markdown check --index src/index.ts README.md",
|
|
36
37
|
"test:format": "virmator format check",
|
|
37
38
|
"test:spelling": "virmator spellcheck",
|
|
38
39
|
"test:types": "tsc --noEmit",
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|