@fr0st/datetime 8.0.2 → 8.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 +17 -3
- package/dist/frost-datetime.esm.js +3251 -0
- package/dist/frost-datetime.esm.js.map +1 -0
- package/dist/frost-datetime.esm.min.js +2 -0
- package/dist/frost-datetime.esm.min.js.map +1 -0
- package/dist/frost-datetime.js +3257 -3887
- package/dist/frost-datetime.js.map +1 -1
- package/dist/frost-datetime.min.js +1 -1
- package/dist/frost-datetime.min.js.map +1 -1
- package/package.json +20 -15
- package/src/date-time.js +6 -9
- package/src/helpers.js +2 -2
package/README.md
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
# FrostDateTime
|
|
2
2
|
|
|
3
3
|
[](https://github.com/elusivecodes/FrostDateTime/actions/workflows/ci.yml)
|
|
4
|
+
[](https://codecov.io/gh/elusivecodes/FrostDateTime)
|
|
4
5
|
[](https://www.npmjs.com/package/@fr0st/datetime)
|
|
5
6
|
[](https://www.npmjs.com/package/@fr0st/datetime)
|
|
6
|
-
[](https://github.com/elusivecodes/FrostDateTime/blob/main/dist/frost-datetime.min.js)
|
|
7
8
|
[](./LICENSE)
|
|
8
9
|
|
|
9
10
|
Immutable date and time handling for JavaScript with locale-aware formatting, parsing, calendar math, and IANA or fixed-offset time zones. FrostDateTime works in Node and bundlers, and also ships a browser-friendly UMD bundle that exposes `globalThis.DateTime`.
|
|
@@ -11,7 +12,7 @@ Immutable date and time handling for JavaScript with locale-aware formatting, pa
|
|
|
11
12
|
## Highlights
|
|
12
13
|
|
|
13
14
|
- Default ESM `DateTime` export for Node and bundlers
|
|
14
|
-
-
|
|
15
|
+
- Prebuilt ESM and UMD bundles in `dist/`
|
|
15
16
|
- No runtime dependencies
|
|
16
17
|
- Immutable operations across getters, setters, and date math
|
|
17
18
|
- Locale-aware formatting, parsing, relative time, and week rules through `Intl`
|
|
@@ -32,6 +33,19 @@ FrostDateTime is ESM-only. Import the default `DateTime` export in Node and bund
|
|
|
32
33
|
import DateTime from '@fr0st/datetime';
|
|
33
34
|
```
|
|
34
35
|
|
|
36
|
+
### Browser (ESM)
|
|
37
|
+
|
|
38
|
+
Import the minified ESM bundle directly from a CDN:
|
|
39
|
+
|
|
40
|
+
```html
|
|
41
|
+
<script type="module">
|
|
42
|
+
import DateTime from 'https://cdn.jsdelivr.net/npm/@fr0st/datetime@latest/dist/frost-datetime.esm.min.js';
|
|
43
|
+
|
|
44
|
+
const date = DateTime.now({ timeZone: 'UTC' });
|
|
45
|
+
console.log(date.toIsoString());
|
|
46
|
+
</script>
|
|
47
|
+
```
|
|
48
|
+
|
|
35
49
|
### Browser (UMD)
|
|
36
50
|
|
|
37
51
|
Load the bundle from your own copy or a CDN:
|
|
@@ -398,7 +412,7 @@ DateTime.clearDataCache();
|
|
|
398
412
|
|
|
399
413
|
```bash
|
|
400
414
|
npm test
|
|
401
|
-
npm run
|
|
415
|
+
npm run lint
|
|
402
416
|
npm run build
|
|
403
417
|
```
|
|
404
418
|
|