mdtg 3.0.0 → 3.1.0
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 +6 -6
- package/package.json +1 -1
- package/src/format.js +1 -1
- package/src/index.js +1 -1
package/README.md
CHANGED
|
@@ -11,13 +11,13 @@ npm install mdtg
|
|
|
11
11
|
### Usage
|
|
12
12
|
|
|
13
13
|
```js
|
|
14
|
-
import { parse,
|
|
14
|
+
import { parse, formatMDTG } from "mdtg";
|
|
15
15
|
|
|
16
16
|
const date = new Date();
|
|
17
17
|
|
|
18
|
-
console.log(
|
|
19
|
-
console.log(
|
|
20
|
-
console.log(
|
|
18
|
+
console.log(formatMDTG(date, { form: "short" }));
|
|
19
|
+
console.log(formatMDTG(date, { form: "shortened" }));
|
|
20
|
+
console.log(formatMDTG(date, { form: "long" }));
|
|
21
21
|
|
|
22
22
|
console.log(parse("12135530Zaug24"));
|
|
23
23
|
console.log(parse("12135530Asep24"));
|
|
@@ -27,7 +27,7 @@ console.log(parse("121355M"));
|
|
|
27
27
|
|
|
28
28
|
### API
|
|
29
29
|
|
|
30
|
-
#### `
|
|
30
|
+
#### `formatMDTG(date, options)`
|
|
31
31
|
|
|
32
32
|
Converts a valid `Date` to a date-time group. `date` defaults to the current
|
|
33
33
|
date. `options.form` is `"short"`, `"shortened"`, or `"long"` (the default).
|
|
@@ -35,7 +35,7 @@ date. `options.form` is `"short"`, `"shortened"`, or `"long"` (the default).
|
|
|
35
35
|
lowercase letters are accepted and unknown values default to `Z`.
|
|
36
36
|
|
|
37
37
|
```js
|
|
38
|
-
|
|
38
|
+
formatMDTG(new Date(Date.UTC(2024, 7, 12, 11, 55, 30)), {
|
|
39
39
|
form: "long",
|
|
40
40
|
timezone: "A",
|
|
41
41
|
});
|
package/package.json
CHANGED
package/src/format.js
CHANGED
package/src/index.js
CHANGED