date-vir 8.6.0 → 8.6.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.
|
@@ -57,18 +57,18 @@ export declare function toTimestamp(fullDate: FullDate): number;
|
|
|
57
57
|
*/
|
|
58
58
|
export declare function toUtcIsoString(fullDate: FullDate): UtcIsoString;
|
|
59
59
|
/**
|
|
60
|
-
* Parse the given {@link DateLike}
|
|
61
|
-
*
|
|
62
|
-
* shorthand for `toUtcIsoString(
|
|
60
|
+
* Parse the given {@link DateLike} and convert it directly into a UTC ISO 8601 string, always ending
|
|
61
|
+
* in Z (for example `'2024-01-05T01:01:01.001Z'`). The input is always interpreted as UTC time.
|
|
62
|
+
* This is a shorthand for `toUtcIsoString(createUtcFullDate(dateLike))`.
|
|
63
63
|
*
|
|
64
64
|
* @category ISO
|
|
65
65
|
* @category Formatting
|
|
66
66
|
* @example
|
|
67
67
|
*
|
|
68
68
|
* ```ts
|
|
69
|
-
* import {createUtcIsoString
|
|
69
|
+
* import {createUtcIsoString} from 'date-vir';
|
|
70
70
|
*
|
|
71
|
-
* createUtcIsoString('June 1, 2024'
|
|
71
|
+
* createUtcIsoString('June 1, 2024');
|
|
72
72
|
* createUtcIsoString(new Date());
|
|
73
73
|
* ```
|
|
74
74
|
*
|
|
@@ -77,9 +77,7 @@ export declare function toUtcIsoString(fullDate: FullDate): UtcIsoString;
|
|
|
77
77
|
*/
|
|
78
78
|
export declare function createUtcIsoString(
|
|
79
79
|
/** The original date representation to be converted into a UTC ISO string. */
|
|
80
|
-
dateLike: Readonly<DateLike
|
|
81
|
-
/** The timezone that this date/time is meant for / originated from. */
|
|
82
|
-
timezone?: string): UtcIsoString;
|
|
80
|
+
dateLike: Readonly<DateLike>): UtcIsoString;
|
|
83
81
|
/**
|
|
84
82
|
* Convert a FullDate into an RFC 1123 / HTTP-date string in GMT (for example `'Fri, 05 Jan 2024
|
|
85
83
|
* 01:01:01 GMT'`). This is the format used by HTTP headers (per RFC 9110), and is identical to what
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { createUtcFullDate } from '../full-date/create-full-date.js';
|
|
2
2
|
import { toLuxonDateTime } from '../full-date/luxon-date-time-conversion.js';
|
|
3
|
-
import {
|
|
3
|
+
import { utcTimezone } from '../timezone/timezones.js';
|
|
4
4
|
/**
|
|
5
5
|
* Convert a FullDate into a unix timestamp with milliseconds.
|
|
6
6
|
*
|
|
@@ -67,18 +67,18 @@ export function toUtcIsoString(fullDate) {
|
|
|
67
67
|
return isoString;
|
|
68
68
|
}
|
|
69
69
|
/**
|
|
70
|
-
* Parse the given {@link DateLike}
|
|
71
|
-
*
|
|
72
|
-
* shorthand for `toUtcIsoString(
|
|
70
|
+
* Parse the given {@link DateLike} and convert it directly into a UTC ISO 8601 string, always ending
|
|
71
|
+
* in Z (for example `'2024-01-05T01:01:01.001Z'`). The input is always interpreted as UTC time.
|
|
72
|
+
* This is a shorthand for `toUtcIsoString(createUtcFullDate(dateLike))`.
|
|
73
73
|
*
|
|
74
74
|
* @category ISO
|
|
75
75
|
* @category Formatting
|
|
76
76
|
* @example
|
|
77
77
|
*
|
|
78
78
|
* ```ts
|
|
79
|
-
* import {createUtcIsoString
|
|
79
|
+
* import {createUtcIsoString} from 'date-vir';
|
|
80
80
|
*
|
|
81
|
-
* createUtcIsoString('June 1, 2024'
|
|
81
|
+
* createUtcIsoString('June 1, 2024');
|
|
82
82
|
* createUtcIsoString(new Date());
|
|
83
83
|
* ```
|
|
84
84
|
*
|
|
@@ -87,10 +87,8 @@ export function toUtcIsoString(fullDate) {
|
|
|
87
87
|
*/
|
|
88
88
|
export function createUtcIsoString(
|
|
89
89
|
/** The original date representation to be converted into a UTC ISO string. */
|
|
90
|
-
dateLike
|
|
91
|
-
|
|
92
|
-
timezone = userTimezone) {
|
|
93
|
-
return toUtcIsoString(createFullDate(dateLike, timezone));
|
|
90
|
+
dateLike) {
|
|
91
|
+
return toUtcIsoString(createUtcFullDate(dateLike));
|
|
94
92
|
}
|
|
95
93
|
/**
|
|
96
94
|
* Convert a FullDate into an RFC 1123 / HTTP-date string in GMT (for example `'Fri, 05 Jan 2024
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "date-vir",
|
|
3
|
-
"version": "8.6.
|
|
3
|
+
"version": "8.6.2",
|
|
4
4
|
"description": "Easy and explicit dates and times.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"date",
|
|
@@ -34,16 +34,16 @@
|
|
|
34
34
|
"test:docs": "virmator docs check"
|
|
35
35
|
},
|
|
36
36
|
"dependencies": {
|
|
37
|
-
"@augment-vir/assert": "^
|
|
38
|
-
"@augment-vir/common": "^
|
|
39
|
-
"@date-vir/duration": "^8.6.
|
|
40
|
-
"@types/luxon": "^3.7.
|
|
37
|
+
"@augment-vir/assert": "^32.0.0",
|
|
38
|
+
"@augment-vir/common": "^32.0.0",
|
|
39
|
+
"@date-vir/duration": "^8.6.2",
|
|
40
|
+
"@types/luxon": "^3.7.2",
|
|
41
41
|
"luxon": "^3.7.2",
|
|
42
42
|
"object-shape-tester": "^6.14.0",
|
|
43
43
|
"type-fest": "^5.7.0"
|
|
44
44
|
},
|
|
45
45
|
"devDependencies": {
|
|
46
|
-
"@augment-vir/test": "^
|
|
46
|
+
"@augment-vir/test": "^32.0.0",
|
|
47
47
|
"@web/dev-server-esbuild": "^1.0.5",
|
|
48
48
|
"@web/test-runner": "^0.20.2",
|
|
49
49
|
"@web/test-runner-commands": "^0.9.0",
|
|
@@ -51,7 +51,7 @@
|
|
|
51
51
|
"@web/test-runner-visual-regression": "^0.10.0",
|
|
52
52
|
"element-vir": "^26.17.0",
|
|
53
53
|
"istanbul-smart-text-reporter": "^1.1.5",
|
|
54
|
-
"markdown-code-example-inserter": "^3.0.
|
|
54
|
+
"markdown-code-example-inserter": "^3.0.6",
|
|
55
55
|
"typedoc": "^0.28.19",
|
|
56
56
|
"typescript": "^6.0.3"
|
|
57
57
|
},
|