mdtg 4.1.6 → 4.1.7
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/README.md +10 -10
- package/package.json +3 -1
package/README.md
CHANGED
|
@@ -15,16 +15,16 @@ import { formatMDTG, parseMDTG } from "mdtg";
|
|
|
15
15
|
|
|
16
16
|
const date = new Date(Date.UTC(2024, 7, 12, 11, 55, 30));
|
|
17
17
|
|
|
18
|
-
formatMDTG(date, { form: "short" });
|
|
19
|
-
formatMDTG(date, { form: "standard" });
|
|
20
|
-
formatMDTG(date);
|
|
18
|
+
formatMDTG(date, { form: "short" }); // "121155Z"
|
|
19
|
+
formatMDTG(date, { form: "standard" }); // "121155Zaug24"
|
|
20
|
+
formatMDTG(date); // "12115530Zaug24" (extended by default)
|
|
21
21
|
|
|
22
22
|
// A is UTC+1, so local time is one hour ahead of UTC.
|
|
23
23
|
const value = formatMDTG(date, { timezone: "A" }); // "12125530Aaug24"
|
|
24
|
-
parseMDTG(value).toISOString();
|
|
24
|
+
parseMDTG(value).toISOString(); // "2024-08-12T11:55:30.000Z"
|
|
25
25
|
|
|
26
26
|
parseMDTG("121155Zaug24").toISOString(); // "2024-08-12T11:55:00.000Z"
|
|
27
|
-
parseMDTG("121155Z");
|
|
27
|
+
parseMDTG("121155Z"); // month and year are current UTC month/year
|
|
28
28
|
```
|
|
29
29
|
|
|
30
30
|
### API
|
|
@@ -56,7 +56,7 @@ month and year and have no seconds. Years are interpreted as `2000` through
|
|
|
56
56
|
```js
|
|
57
57
|
import { parseMDTG } from "mdtg";
|
|
58
58
|
|
|
59
|
-
parseMDTG("121155Zaug24").toISOString();
|
|
59
|
+
parseMDTG("121155Zaug24").toISOString(); // "2024-08-12T11:55:00.000Z"
|
|
60
60
|
parseMDTG("12115530Zaug24").toISOString(); // "2024-08-12T11:55:30.000Z"
|
|
61
61
|
parseMDTG("12125530Aaug24").toISOString(); // "2024-08-12T11:55:30.000Z"
|
|
62
62
|
|
|
@@ -89,12 +89,12 @@ import {
|
|
|
89
89
|
isValidMDTG,
|
|
90
90
|
} from "mdtg";
|
|
91
91
|
|
|
92
|
-
isShortFormat("121155Z");
|
|
92
|
+
isShortFormat("121155Z"); // true
|
|
93
93
|
isStandardFormat("121155Zaug24"); // true
|
|
94
94
|
isExtendedFormat("12115530Zaug24"); // true
|
|
95
|
-
isMDTG("121155Zaug24");
|
|
96
|
-
isMDTG("invalid");
|
|
97
|
-
isMDTG("310224Zfeb24");
|
|
95
|
+
isMDTG("121155Zaug24"); // true
|
|
96
|
+
isMDTG("invalid"); // false
|
|
97
|
+
isMDTG("310224Zfeb24"); // true: structurally valid
|
|
98
98
|
isValidMDTG("310224Zfeb24"); // false: invalid calendar date
|
|
99
99
|
```
|
|
100
100
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "mdtg",
|
|
3
|
-
"version": "4.1.
|
|
3
|
+
"version": "4.1.7",
|
|
4
4
|
"main": "src/index.js",
|
|
5
5
|
"types": "src/index.d.ts",
|
|
6
6
|
"type": "module",
|
|
@@ -23,6 +23,7 @@
|
|
|
23
23
|
"lint": "biome lint .",
|
|
24
24
|
"prettier": "prettier **/*.yml",
|
|
25
25
|
"test": "vitest run",
|
|
26
|
+
"test:integration": "vitest run test/integration",
|
|
26
27
|
"test:mutation": "stryker run"
|
|
27
28
|
},
|
|
28
29
|
"keywords": [
|
|
@@ -40,6 +41,7 @@
|
|
|
40
41
|
"@systemfsoftware/stryker-js": "15.0.1",
|
|
41
42
|
"@systemfsoftware/stryker-js-vitest-runner": "8.0.3",
|
|
42
43
|
"@vitest/coverage-v8": "5.0.3",
|
|
44
|
+
"fast-check": "4.10.2",
|
|
43
45
|
"knip": "6.39.0",
|
|
44
46
|
"prettier": "3.9.9",
|
|
45
47
|
"vitest": "5.0.3"
|