@fr0st/datetime 8.1.1 → 8.1.2
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 +12 -12
- package/package.json +5 -5
package/README.md
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
#
|
|
1
|
+
# Frost DateTime
|
|
2
2
|
|
|
3
|
-
[](https://github.com/frost-js/datetime/actions/workflows/ci.yml)
|
|
4
|
+
[](https://codecov.io/gh/frost-js/datetime)
|
|
5
5
|
[](https://www.npmjs.com/package/@fr0st/datetime)
|
|
6
6
|
[](https://www.npmjs.com/package/@fr0st/datetime)
|
|
7
|
-
[](https://github.com/frost-js/datetime/blob/main/dist/frost-datetime.min.js)
|
|
8
|
+
[](./LICENSE)
|
|
9
9
|
|
|
10
|
-
Immutable date and time handling for JavaScript with locale-aware formatting, parsing, calendar math, and IANA or fixed-offset time zones.
|
|
10
|
+
Immutable date and time handling for JavaScript with locale-aware formatting, parsing, calendar math, and IANA or fixed-offset time zones. Frost DateTime works in Node and bundlers, and also ships a browser-friendly UMD bundle that exposes `globalThis.DateTime`.
|
|
11
11
|
|
|
12
12
|
## Highlights
|
|
13
13
|
|
|
@@ -27,7 +27,7 @@ Immutable date and time handling for JavaScript with locale-aware formatting, pa
|
|
|
27
27
|
npm i @fr0st/datetime
|
|
28
28
|
```
|
|
29
29
|
|
|
30
|
-
|
|
30
|
+
Frost DateTime's package entry point is ESM-only. Import the default `DateTime` export in Node and bundlers.
|
|
31
31
|
|
|
32
32
|
```js
|
|
33
33
|
import DateTime from '@fr0st/datetime';
|
|
@@ -85,11 +85,11 @@ nextWeek.monthName();
|
|
|
85
85
|
// March
|
|
86
86
|
```
|
|
87
87
|
|
|
88
|
-
TypeScript note:
|
|
88
|
+
TypeScript note: Frost DateTime is written in JavaScript and uses JSDoc types, which most editors surface as IntelliSense.
|
|
89
89
|
|
|
90
90
|
## Date Model
|
|
91
91
|
|
|
92
|
-
|
|
92
|
+
Frost DateTime revolves around an immutable `DateTime` class and a small set of predictable parsing and formatting rules.
|
|
93
93
|
|
|
94
94
|
- Every setter and manipulation method returns a new instance
|
|
95
95
|
- Constructor numbers are milliseconds since the UNIX epoch
|
|
@@ -113,7 +113,7 @@ new DateTime('January 1, 2019 00:00:00', { timeZone: 'Australia/Brisbane' })
|
|
|
113
113
|
|
|
114
114
|
## API
|
|
115
115
|
|
|
116
|
-
|
|
116
|
+
Frost DateTime exports a default `DateTime` class from `@fr0st/datetime`.
|
|
117
117
|
|
|
118
118
|
### Creating dates
|
|
119
119
|
|
|
@@ -176,7 +176,7 @@ Format tokens are documented in [Formats.md](./Formats.md).
|
|
|
176
176
|
|
|
177
177
|
### Formatting and output
|
|
178
178
|
|
|
179
|
-
- `format(formatString)`: format with
|
|
179
|
+
- `format(formatString)`: format with Frost DateTime's token set
|
|
180
180
|
- `toString()`: `eee MMM dd yyyy HH:mm:ss xx (VV)`
|
|
181
181
|
- `toDateString()`: `eee MMM dd yyyy`
|
|
182
182
|
- `toTimeString()`: `HH:mm:ss xx (VV)`
|
|
@@ -420,4 +420,4 @@ npm run build
|
|
|
420
420
|
|
|
421
421
|
## License
|
|
422
422
|
|
|
423
|
-
|
|
423
|
+
Frost DateTime is released under the [MIT License](./LICENSE).
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fr0st/datetime",
|
|
3
|
-
"version": "8.1.
|
|
3
|
+
"version": "8.1.2",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "Immutable date and time handling for JavaScript with locale-aware formatting, parsing, calendar math, and IANA or fixed-offset time zones.",
|
|
6
6
|
"keywords": [
|
|
@@ -14,14 +14,14 @@
|
|
|
14
14
|
"parse",
|
|
15
15
|
"format"
|
|
16
16
|
],
|
|
17
|
-
"homepage": "https://github.com/
|
|
17
|
+
"homepage": "https://github.com/frost-js/datetime",
|
|
18
18
|
"bugs": {
|
|
19
|
-
"url": "https://github.com/
|
|
19
|
+
"url": "https://github.com/frost-js/datetime/issues",
|
|
20
20
|
"email": "elusivecodes@gmail.com"
|
|
21
21
|
},
|
|
22
22
|
"repository": {
|
|
23
23
|
"type": "git",
|
|
24
|
-
"url": "git+https://github.com/
|
|
24
|
+
"url": "git+https://github.com/frost-js/datetime.git"
|
|
25
25
|
},
|
|
26
26
|
"license": "MIT",
|
|
27
27
|
"author": "Elusive <elusivecodes@gmail.com>",
|
|
@@ -54,7 +54,7 @@
|
|
|
54
54
|
"test:coverage": "vitest run --coverage"
|
|
55
55
|
},
|
|
56
56
|
"devDependencies": {
|
|
57
|
-
"@fr0st/eslint-config": "^5.0.
|
|
57
|
+
"@fr0st/eslint-config": "^5.0.3",
|
|
58
58
|
"@vitest/coverage-v8": "^4.1.11",
|
|
59
59
|
"eslint": "^10.9.1",
|
|
60
60
|
"vite": "^8.2.2",
|