inray 0.1.0 → 0.1.1
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 +2 -2
- package/dist/date-fns/tz/src/date/index.d.ts +150 -9
- package/dist/date-fns/tz/src/date/index.d.ts.map +1 -1
- package/dist/date-fns/tz/src/date/index.js +38 -5
- package/dist/date-fns/tz/src/date/index.js.map +1 -1
- package/dist/date-fns/tz/src/date/mini.d.ts +239 -6
- package/dist/date-fns/tz/src/date/mini.d.ts.map +1 -1
- package/dist/date-fns/tz/src/date/mini.js +49 -44
- package/dist/date-fns/tz/src/date/mini.js.map +1 -1
- package/dist/date-fns/tz/src/index.d.ts +2 -2
- package/dist/date-fns/tz/src/index.js +2 -2
- package/dist/date-fns/tz/src/tz/index.d.ts +1 -1
- package/dist/date-fns/tz/src/tz/index.js +1 -1
- package/dist/date-fns/utc/src/date/index.d.ts +31 -15
- package/dist/date-fns/utc/src/date/index.d.ts.map +1 -1
- package/dist/date-fns/utc/src/date/index.js +19 -17
- package/dist/date-fns/utc/src/date/index.js.map +1 -1
- package/dist/date-fns/utc/src/date/mini.d.ts +18 -2
- package/dist/date-fns/utc/src/date/mini.d.ts.map +1 -1
- package/dist/date-fns/utc/src/date/mini.js +24 -13
- package/dist/date-fns/utc/src/date/mini.js.map +1 -1
- package/dist/date-fns/utc/src/index.d.ts +2 -2
- package/dist/date-fns/utc/src/index.js +2 -2
- package/dist/date-fns/utc/src/utc/index.d.ts +1 -1
- package/dist/date-fns/utc/src/utc/index.js +1 -1
- package/package.json +7 -4
package/README.md
CHANGED
|
@@ -6,7 +6,7 @@ Inray - all-in-one инструментарий для разработки **No
|
|
|
6
6
|
|
|
7
7
|
- [Основная идея проекта](#основная-идея-проекта)
|
|
8
8
|
- [Причины и особенности реализации](#причины-и-особенности-реализации)
|
|
9
|
-
- [Уровни SDK, текущий пакет inray
|
|
9
|
+
- [Уровни SDK, текущий пакет inray](#уровни-sdk-текущий-пакет-inray)
|
|
10
10
|
- [Текущий состав SDK](#текущий-состав-sdk)
|
|
11
11
|
- [Документация](#документация-и-примеры-использования)
|
|
12
12
|
- [Совместимость](#совместимость)
|
|
@@ -100,7 +100,7 @@ Inray - all-in-one инструментарий для разработки **No
|
|
|
100
100
|
\* _уровень может отображать как итог, так и процесс_
|
|
101
101
|
|
|
102
102
|
|
|
103
|
-
## Уровни SDK
|
|
103
|
+
## Уровни SDK
|
|
104
104
|
|
|
105
105
|
<img src="https://codeberg.org/mirakl-026/inray-ekspa/raw/branch/main/doc/inray-levels.png" alt="Inray levels" width="965" height="661">
|
|
106
106
|
|
|
@@ -1,11 +1,152 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
1
|
+
/**
|
|
2
|
+
* Original library: date-fns (v4.4.0)
|
|
3
|
+
* - Copyright © 2024 Sasha Koss
|
|
4
|
+
*
|
|
5
|
+
* Modified and integrated in "Inray":
|
|
6
|
+
* - Evgeniy Bushin
|
|
7
|
+
* - z.AI, GLM 5.3
|
|
8
|
+
*/
|
|
9
|
+
/***/
|
|
10
|
+
import { constructFromSymbol } from '../constants/index.ts';
|
|
11
|
+
import { TZDateMini } from './mini.ts';
|
|
12
|
+
/**
|
|
13
|
+
* Time zone date class. It overrides original Date functions making them
|
|
14
|
+
* to perform all the calculations in the given time zone.
|
|
15
|
+
*
|
|
16
|
+
* It also provides new functions useful when working with time zones.
|
|
17
|
+
*
|
|
18
|
+
* Combined with date-fns, it allows using the class the same way as
|
|
19
|
+
* the original date class.
|
|
20
|
+
*
|
|
21
|
+
* This complete version provides formatter functions, mirroring all original
|
|
22
|
+
* methods of the `Date` class. It's build-size-heavier than `TZDateMini` and
|
|
23
|
+
* should be used when you need to format a string or in an environment you
|
|
24
|
+
* don't fully control (a library).
|
|
25
|
+
*
|
|
26
|
+
* For the minimal version, see `TZDateMini`.
|
|
27
|
+
*/
|
|
28
|
+
export declare class TZDate extends TZDateMini {
|
|
29
|
+
/**
|
|
30
|
+
* Creates a new `TZDate` instance in the given time zone.
|
|
31
|
+
*
|
|
32
|
+
* @param tz - Time zone name (IANA or UTC offset)
|
|
33
|
+
*/
|
|
34
|
+
static tz(tz: string): TZDate;
|
|
35
|
+
/**
|
|
36
|
+
* Creates a new `TZDate` instance in the given time zone from the Unix
|
|
37
|
+
* timestamp in milliseconds.
|
|
38
|
+
*
|
|
39
|
+
* @param tz - Time zone name (IANA or UTC offset)
|
|
40
|
+
* @param timestamp - Unix timestamp in milliseconds
|
|
41
|
+
*/
|
|
42
|
+
static tz(tz: string, timestamp: number): TZDate;
|
|
43
|
+
/**
|
|
44
|
+
* Creates a new `TZDate` instance in the given time zone from the date time
|
|
45
|
+
* string.
|
|
46
|
+
*
|
|
47
|
+
* @param tz - Time zone name (IANA or UTC offset)
|
|
48
|
+
* @param dateStr - Date time string
|
|
49
|
+
*/
|
|
50
|
+
static tz(tz: string, dateStr: string): TZDate;
|
|
51
|
+
/**
|
|
52
|
+
* Creates a new `TZDate` instance in the given time zone from the date object.
|
|
53
|
+
*
|
|
54
|
+
* @param tz - Time zone name (IANA or UTC offset)
|
|
55
|
+
* @param date - Date object
|
|
56
|
+
*/
|
|
57
|
+
static tz(tz: string, date: Date): TZDate;
|
|
58
|
+
/**
|
|
59
|
+
* Creates a new `TZDate` instance in the given time zone from the year
|
|
60
|
+
* and month.
|
|
61
|
+
*
|
|
62
|
+
* @param tz - Time zone name (IANA or UTC offset)
|
|
63
|
+
* @param year - Year
|
|
64
|
+
* @param month - Month (0-11)
|
|
65
|
+
*/
|
|
66
|
+
static tz(tz: string, year: number, month: number): TZDate;
|
|
67
|
+
/**
|
|
68
|
+
* Creates a new `TZDate` instance in the given time zone from the year,
|
|
69
|
+
* month and date.
|
|
70
|
+
*
|
|
71
|
+
* @param tz - Time zone name (IANA or UTC offset)
|
|
72
|
+
* @param year - Year
|
|
73
|
+
* @param month - Month (0-11)
|
|
74
|
+
* @param date - Date
|
|
75
|
+
*/
|
|
76
|
+
static tz(tz: string, year: number, month: number, date: number): TZDate;
|
|
77
|
+
/**
|
|
78
|
+
* Creates a new `TZDate` instance in the given time zone from the year,
|
|
79
|
+
* month, date and hours.
|
|
80
|
+
*
|
|
81
|
+
* @param tz - Time zone name (IANA or UTC offset)
|
|
82
|
+
* @param year - Year
|
|
83
|
+
* @param month - Month (0-11)
|
|
84
|
+
* @param date - Date
|
|
85
|
+
* @param hours - Hours
|
|
86
|
+
*/
|
|
87
|
+
static tz(tz: string, year: number, month: number, date: number, hours: number): TZDate;
|
|
88
|
+
/**
|
|
89
|
+
* Creates a new `TZDate` instance in the given time zone from the year,
|
|
90
|
+
* month, date, hours and minutes.
|
|
91
|
+
*
|
|
92
|
+
* @param tz - Time zone name (IANA or UTC offset)
|
|
93
|
+
* @param year - Year
|
|
94
|
+
* @param month - Month (0-11)
|
|
95
|
+
* @param date - Date
|
|
96
|
+
* @param hours - Hours
|
|
97
|
+
* @param minutes - Minutes
|
|
98
|
+
*/
|
|
99
|
+
static tz(tz: string, year: number, month: number, date: number, hours: number, minutes: number): TZDate;
|
|
100
|
+
/**
|
|
101
|
+
* Creates a new `TZDate` instance in the given time zone from the year,
|
|
102
|
+
* month, date, hours, minutes and seconds.
|
|
103
|
+
*
|
|
104
|
+
* @param tz - Time zone name (IANA or UTC offset)
|
|
105
|
+
* @param year - Year
|
|
106
|
+
* @param month - Month (0-11)
|
|
107
|
+
* @param date - Date
|
|
108
|
+
* @param hours - Hours
|
|
109
|
+
* @param minutes - Minutes
|
|
110
|
+
* @param seconds - Seconds
|
|
111
|
+
*/
|
|
112
|
+
static tz(tz: string, year: number, month: number, date: number, hours: number, minutes: number, seconds: number): TZDate;
|
|
113
|
+
/**
|
|
114
|
+
* Creates a new `TZDate` instance in the given time zone from the year,
|
|
115
|
+
* month, date, hours, minutes, seconds and milliseconds.
|
|
116
|
+
*
|
|
117
|
+
* @param tz - Time zone name (IANA or UTC offset)
|
|
118
|
+
* @param year - Year
|
|
119
|
+
* @param month - Month (0-11)
|
|
120
|
+
* @param date - Date
|
|
121
|
+
* @param hours - Hours
|
|
122
|
+
* @param minutes - Minutes
|
|
123
|
+
* @param seconds - Seconds
|
|
124
|
+
* @param milliseconds - Milliseconds
|
|
125
|
+
*/
|
|
126
|
+
static tz(tz: string, year: number, month: number, date: number, hours: number, minutes: number, seconds: number, milliseconds: number): TZDate;
|
|
127
|
+
toISOString(): string;
|
|
128
|
+
toString(): string;
|
|
129
|
+
toDateString(): string;
|
|
130
|
+
toTimeString(): string;
|
|
131
|
+
toLocaleString(locales?: string | string[], options?: Intl.DateTimeFormatOptions): string;
|
|
132
|
+
toLocaleDateString(locales?: string | string[], options?: Intl.DateTimeFormatOptions): string;
|
|
133
|
+
toLocaleTimeString(locales?: string | string[], options?: Intl.DateTimeFormatOptions): string;
|
|
134
|
+
/**
|
|
135
|
+
* Returns the time zone offset components of the date.
|
|
136
|
+
*
|
|
137
|
+
* @internal
|
|
138
|
+
*/
|
|
139
|
+
tzComponents(): [string, string, string];
|
|
140
|
+
/**
|
|
141
|
+
* Creates a new `TZDate` instance in the given time zone.
|
|
142
|
+
*/
|
|
143
|
+
withTimeZone(timeZone: string): TZDate;
|
|
144
|
+
/**
|
|
145
|
+
* Creates a new `TZDate` instance in the current instance time zone and
|
|
146
|
+
* the specified date time value.
|
|
147
|
+
*
|
|
148
|
+
* @param date - Date value to create a new instance from
|
|
149
|
+
*/
|
|
150
|
+
[constructFromSymbol](date: Date | number | string): TZDate;
|
|
9
151
|
}
|
|
10
|
-
export {};
|
|
11
152
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/date-fns/tz/src/date/index.
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/date-fns/tz/src/date/index.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAC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6
6
|
* - Evgeniy Bushin
|
|
7
|
+
* - z.AI, GLM 5.3
|
|
7
8
|
*/
|
|
8
9
|
/***/
|
|
9
|
-
|
|
10
|
+
import { constructFromSymbol } from "../constants/index.js";
|
|
10
11
|
import { tzName } from "../tzName/index.js";
|
|
11
|
-
import { TZDateMini } from
|
|
12
|
+
import { TZDateMini } from "./mini.js";
|
|
13
|
+
/**
|
|
14
|
+
* Time zone date class. It overrides original Date functions making them
|
|
15
|
+
* to perform all the calculations in the given time zone.
|
|
16
|
+
*
|
|
17
|
+
* It also provides new functions useful when working with time zones.
|
|
18
|
+
*
|
|
19
|
+
* Combined with date-fns, it allows using the class the same way as
|
|
20
|
+
* the original date class.
|
|
21
|
+
*
|
|
22
|
+
* This complete version provides formatter functions, mirroring all original
|
|
23
|
+
* methods of the `Date` class. It's build-size-heavier than `TZDateMini` and
|
|
24
|
+
* should be used when you need to format a string or in an environment you
|
|
25
|
+
* don't fully control (a library).
|
|
26
|
+
*
|
|
27
|
+
* For the minimal version, see `TZDateMini`.
|
|
28
|
+
*/
|
|
12
29
|
export class TZDate extends TZDateMini {
|
|
13
|
-
//#region static
|
|
14
30
|
static tz(tz, ...args) {
|
|
15
|
-
|
|
31
|
+
// The constructor overloads can't verify a spread with the appended time
|
|
32
|
+
// zone argument, so use a permissive constructor type instead.
|
|
33
|
+
const construct = TZDate;
|
|
34
|
+
return args.length ? new construct(...args, tz) : new construct(Date.now(), tz);
|
|
16
35
|
}
|
|
17
36
|
//#endregion
|
|
18
37
|
//#region representation
|
|
@@ -58,6 +77,11 @@ export class TZDate extends TZDateMini {
|
|
|
58
77
|
}
|
|
59
78
|
//#endregion
|
|
60
79
|
//#region private
|
|
80
|
+
/**
|
|
81
|
+
* Returns the time zone offset components of the date.
|
|
82
|
+
*
|
|
83
|
+
* @internal
|
|
84
|
+
*/
|
|
61
85
|
tzComponents() {
|
|
62
86
|
const offset = this.getTimezoneOffset();
|
|
63
87
|
const sign = offset > 0 ? '-' : '+';
|
|
@@ -66,11 +90,20 @@ export class TZDate extends TZDateMini {
|
|
|
66
90
|
return [sign, hours, minutes];
|
|
67
91
|
}
|
|
68
92
|
//#endregion
|
|
93
|
+
/**
|
|
94
|
+
* Creates a new `TZDate` instance in the given time zone.
|
|
95
|
+
*/
|
|
69
96
|
withTimeZone(timeZone) {
|
|
70
97
|
return new TZDate(+this, timeZone);
|
|
71
98
|
}
|
|
72
99
|
//#region date-fns integration
|
|
73
|
-
|
|
100
|
+
/**
|
|
101
|
+
* Creates a new `TZDate` instance in the current instance time zone and
|
|
102
|
+
* the specified date time value.
|
|
103
|
+
*
|
|
104
|
+
* @param date - Date value to create a new instance from
|
|
105
|
+
*/
|
|
106
|
+
[constructFromSymbol](date) {
|
|
74
107
|
return new TZDate(+new Date(date), this.timeZone);
|
|
75
108
|
}
|
|
76
109
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/date-fns/tz/src/date/index.
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/date-fns/tz/src/date/index.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,KAAK;AAEL,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAC5D,OAAO,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAC5C,OAAO,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AAEvC;;;;;;;;;;;;;;;GAeG;AACH,MAAM,OAAO,MAAO,SAAQ,UAAU;IAgIpC,MAAM,CAAC,EAAE,CAAC,EAAU,EAAE,GAAG,IAAe;QACtC,yEAAyE;QACzE,+DAA+D;QAC/D,MAAM,SAAS,GAAG,MAAuD,CAAC;QAC1E,OAAO,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,IAAI,SAAS,CAAC,GAAG,IAAI,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,IAAI,SAAS,CAAC,IAAI,CAAC,GAAG,EAAE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AAE,OAAO,CAAC,CAAC;IAChC,CAAC;IAED,YAAY;IAEZ;;OAEG;IACH,YAAY,CAAC,QAAgB;QAC3B,OAAO,IAAI,MAAM,CAAC,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAC;IACrC,CAAC;IAED,8BAA8B;IAE9B;;;;;OAKG;IACH,CAAC,mBAAmB,CAAC,CAAC,IAA4B;QAChD,OAAO,IAAI,MAAM,CAAC,CAAC,IAAI,IAAI,CAAC,IAAI,CAAC,EAAE,IAAI,CAAC,QAAQ,CAAC,CAAC;IACpD,CAAC;CAGF"}
|
|
@@ -1,9 +1,242 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
/**
|
|
2
|
+
* Original library: date-fns (v4.4.0)
|
|
3
|
+
* - Copyright © 2024 Sasha Koss
|
|
4
|
+
*
|
|
5
|
+
* Modified and integrated in "Inray":
|
|
6
|
+
* - Evgeniy Bushin
|
|
7
|
+
* - z.AI, GLM 5.3
|
|
8
|
+
*/
|
|
9
|
+
/***/
|
|
10
|
+
import { constructFromSymbol } from '../constants/index.ts';
|
|
11
|
+
/**
|
|
12
|
+
* Time zone date class. It overrides original Date functions making them
|
|
13
|
+
* to perform all the calculations in the given time zone.
|
|
14
|
+
*
|
|
15
|
+
* It also provides new functions useful when working with time zones.
|
|
16
|
+
*
|
|
17
|
+
* Combined with date-fns, it allows using the class the same way as
|
|
18
|
+
* the original date class.
|
|
19
|
+
*
|
|
20
|
+
* This minimal version provides complete functionality required for date-fns
|
|
21
|
+
* and excludes build-size-heavy formatter functions.
|
|
22
|
+
*
|
|
23
|
+
* For the complete version, see `TZDate`.
|
|
24
|
+
*/
|
|
25
|
+
export declare class TZDateMini extends Date {
|
|
26
|
+
/**
|
|
27
|
+
* Constructs a new `TZDateMini` instance in the system time zone.
|
|
28
|
+
*/
|
|
29
|
+
constructor();
|
|
30
|
+
/**
|
|
31
|
+
* Constructs a new `TZDateMini` instance from the date time string and time zone.
|
|
32
|
+
*
|
|
33
|
+
* @param dateStr - Date time string to create a new instance from
|
|
34
|
+
* @param timeZone - Time zone name (IANA or UTC offset)
|
|
35
|
+
*/
|
|
36
|
+
constructor(dateStr: string, timeZone?: string);
|
|
37
|
+
/**
|
|
38
|
+
* Constructs a new `TZDateMini` instance from the date object and time zone.
|
|
39
|
+
*
|
|
40
|
+
* @param date - Date object to create a new instance from
|
|
41
|
+
* @param timeZone - Time zone name (IANA or UTC offset)
|
|
42
|
+
*/
|
|
43
|
+
constructor(date: Date, timeZone?: string);
|
|
44
|
+
/**
|
|
45
|
+
* Constructs a new `TZDateMini` instance from the Unix timestamp in milliseconds
|
|
46
|
+
* and time zone.
|
|
47
|
+
*
|
|
48
|
+
* @param timestamp - Unix timestamp in milliseconds to create a new instance from
|
|
49
|
+
* @param timeZone - Time zone name (IANA or UTC offset)
|
|
50
|
+
*/
|
|
51
|
+
constructor(timestamp: number, timeZone?: string);
|
|
52
|
+
/**
|
|
53
|
+
* Constructs a new `TZDateMini` instance from the year, month, and time zone.
|
|
54
|
+
*
|
|
55
|
+
* @param year - Year
|
|
56
|
+
* @param month - Month (0-11)
|
|
57
|
+
* @param timeZone - Time zone name (IANA or UTC offset)
|
|
58
|
+
*/
|
|
59
|
+
constructor(year: number, month: number, timeZone?: string);
|
|
60
|
+
/**
|
|
61
|
+
* Constructs a new `TZDateMini` instance from the year, month, date and time zone.
|
|
62
|
+
*
|
|
63
|
+
* @param year - Year
|
|
64
|
+
* @param month - Month (0-11)
|
|
65
|
+
* @param date - Date
|
|
66
|
+
* @param timeZone - Time zone name (IANA or UTC offset)
|
|
67
|
+
*/
|
|
68
|
+
constructor(year: number, month: number, date: number, timeZone?: string);
|
|
69
|
+
/**
|
|
70
|
+
* Constructs a new `TZDateMini` instance from the year, month, date, hours
|
|
71
|
+
* and time zone.
|
|
72
|
+
*
|
|
73
|
+
* @param year - Year
|
|
74
|
+
* @param month - Month (0-11)
|
|
75
|
+
* @param date - Date
|
|
76
|
+
* @param hours - Hours
|
|
77
|
+
* @param timeZone - Time zone name (IANA or UTC offset)
|
|
78
|
+
*/
|
|
79
|
+
constructor(year: number, month: number, date: number, hours: number, timeZone?: string);
|
|
80
|
+
/**
|
|
81
|
+
* Constructs a new `TZDateMini` instance from the year, month, date, hours,
|
|
82
|
+
* minutes and time zone.
|
|
83
|
+
*
|
|
84
|
+
* @param year - Year
|
|
85
|
+
* @param month - Month (0-11)
|
|
86
|
+
* @param date - Date
|
|
87
|
+
* @param hours - Hours
|
|
88
|
+
* @param minutes - Minutes
|
|
89
|
+
* @param timeZone - Time zone name (IANA or UTC offset)
|
|
90
|
+
*/
|
|
91
|
+
constructor(year: number, month: number, date: number, hours: number, minutes: number, timeZone?: string);
|
|
92
|
+
/**
|
|
93
|
+
* Constructs a new `TZDateMini` instance from the year, month, date, hours,
|
|
94
|
+
* minutes, seconds and time zone.
|
|
95
|
+
*
|
|
96
|
+
* @param year - Year
|
|
97
|
+
* @param month - Month (0-11)
|
|
98
|
+
* @param date - Date
|
|
99
|
+
* @param hours - Hours
|
|
100
|
+
* @param minutes - Minutes
|
|
101
|
+
* @param seconds - Seconds
|
|
102
|
+
* @param timeZone - Time zone name (IANA or UTC offset)
|
|
103
|
+
*/
|
|
104
|
+
constructor(year: number, month: number, date: number, hours: number, minutes: number, seconds: number, timeZone?: string);
|
|
105
|
+
/**
|
|
106
|
+
* Constructs a new `TZDateMini` instance from the year, month, date, hours,
|
|
107
|
+
* minutes, seconds, milliseconds and time zone.
|
|
108
|
+
*
|
|
109
|
+
* @param year - Year
|
|
110
|
+
* @param month - Month (0-11)
|
|
111
|
+
* @param date - Date
|
|
112
|
+
* @param hours - Hours
|
|
113
|
+
* @param minutes - Minutes
|
|
114
|
+
* @param seconds - Seconds
|
|
115
|
+
* @param milliseconds - Milliseconds
|
|
116
|
+
* @param timeZone - Time zone name (IANA or UTC offset)
|
|
117
|
+
*/
|
|
118
|
+
constructor(year: number, month: number, date: number, hours: number, minutes: number, seconds: number, milliseconds: number, timeZone?: string);
|
|
119
|
+
/**
|
|
120
|
+
* Creates a new `TZDateMini` instance in the given time zone.
|
|
121
|
+
*
|
|
122
|
+
* @param tz - Time zone name (IANA or UTC offset)
|
|
123
|
+
*/
|
|
124
|
+
static tz(tz: string): TZDateMini;
|
|
125
|
+
/**
|
|
126
|
+
* Creates a new `TZDateMini` instance in the given time zone from the Unix
|
|
127
|
+
* timestamp in milliseconds.
|
|
128
|
+
*
|
|
129
|
+
* @param tz - Time zone name (IANA or UTC offset)
|
|
130
|
+
* @param timestamp - Unix timestamp in milliseconds
|
|
131
|
+
*/
|
|
132
|
+
static tz(tz: string, timestamp: number): TZDateMini;
|
|
133
|
+
/**
|
|
134
|
+
* Creates a new `TZDateMini` instance in the given time zone from the date time
|
|
135
|
+
* string.
|
|
136
|
+
*
|
|
137
|
+
* @param tz - Time zone name (IANA or UTC offset)
|
|
138
|
+
* @param dateStr - Date time string
|
|
139
|
+
*/
|
|
140
|
+
static tz(tz: string, dateStr: string): TZDateMini;
|
|
141
|
+
/**
|
|
142
|
+
* Creates a new `TZDateMini` instance in the given time zone from the date object.
|
|
143
|
+
*
|
|
144
|
+
* @param tz - Time zone name (IANA or UTC offset)
|
|
145
|
+
* @param date - Date object
|
|
146
|
+
*/
|
|
147
|
+
static tz(tz: string, date: Date): TZDateMini;
|
|
148
|
+
/**
|
|
149
|
+
* Creates a new `TZDateMini` instance in the given time zone from the year
|
|
150
|
+
* and month.
|
|
151
|
+
*
|
|
152
|
+
* @param tz - Time zone name (IANA or UTC offset)
|
|
153
|
+
* @param year - Year
|
|
154
|
+
* @param month - Month (0-11)
|
|
155
|
+
*/
|
|
156
|
+
static tz(tz: string, year: number, month: number): TZDateMini;
|
|
157
|
+
/**
|
|
158
|
+
* Creates a new `TZDateMini` instance in the given time zone from the year,
|
|
159
|
+
* month and date.
|
|
160
|
+
*
|
|
161
|
+
* @param tz - Time zone name (IANA or UTC offset)
|
|
162
|
+
* @param year - Year
|
|
163
|
+
* @param month - Month (0-11)
|
|
164
|
+
* @param date - Date
|
|
165
|
+
*/
|
|
166
|
+
static tz(tz: string, year: number, month: number, date: number): TZDateMini;
|
|
167
|
+
/**
|
|
168
|
+
* Creates a new `TZDateMini` instance in the given time zone from the year,
|
|
169
|
+
* month, date and hours.
|
|
170
|
+
*
|
|
171
|
+
* @param tz - Time zone name (IANA or UTC offset)
|
|
172
|
+
* @param year - Year
|
|
173
|
+
* @param month - Month (0-11)
|
|
174
|
+
* @param date - Date
|
|
175
|
+
* @param hours - Hours
|
|
176
|
+
*/
|
|
177
|
+
static tz(tz: string, year: number, month: number, date: number, hours: number): TZDateMini;
|
|
178
|
+
/**
|
|
179
|
+
* Creates a new `TZDateMini` instance in the given time zone from the year,
|
|
180
|
+
* month, date, hours and minutes.
|
|
181
|
+
*
|
|
182
|
+
* @param tz - Time zone name (IANA or UTC offset)
|
|
183
|
+
* @param year - Year
|
|
184
|
+
* @param month - Month (0-11)
|
|
185
|
+
* @param date - Date
|
|
186
|
+
* @param hours - Hours
|
|
187
|
+
* @param minutes - Minutes
|
|
188
|
+
*/
|
|
189
|
+
static tz(tz: string, year: number, month: number, date: number, hours: number, minutes: number): TZDateMini;
|
|
190
|
+
/**
|
|
191
|
+
* Creates a new `TZDateMini` instance in the given time zone from the year,
|
|
192
|
+
* month, date, hours, minutes and seconds.
|
|
193
|
+
*
|
|
194
|
+
* @param tz - Time zone name (IANA or UTC offset)
|
|
195
|
+
* @param year - Year
|
|
196
|
+
* @param month - Month (0-11)
|
|
197
|
+
* @param date - Date
|
|
198
|
+
* @param hours - Hours
|
|
199
|
+
* @param minutes - Minutes
|
|
200
|
+
* @param seconds - Seconds
|
|
201
|
+
*/
|
|
202
|
+
static tz(tz: string, year: number, month: number, date: number, hours: number, minutes: number, seconds: number): TZDateMini;
|
|
203
|
+
/**
|
|
204
|
+
* Creates a new `TZDateMini` instance in the given time zone from the year,
|
|
205
|
+
* month, date, hours, minutes, seconds and milliseconds.
|
|
206
|
+
*
|
|
207
|
+
* @param tz - Time zone name (IANA or UTC offset)
|
|
208
|
+
* @param year - Year
|
|
209
|
+
* @param month - Month (0-11)
|
|
210
|
+
* @param date - Date
|
|
211
|
+
* @param hours - Hours
|
|
212
|
+
* @param minutes - Minutes
|
|
213
|
+
* @param seconds - Seconds
|
|
214
|
+
* @param milliseconds - Milliseconds
|
|
215
|
+
*/
|
|
216
|
+
static tz(tz: string, year: number, month: number, date: number, hours: number, minutes: number, seconds: number, milliseconds: number): TZDateMini;
|
|
217
|
+
/**
|
|
218
|
+
* The current time zone of the date.
|
|
219
|
+
*/
|
|
220
|
+
readonly timeZone: string | undefined;
|
|
221
|
+
/**
|
|
222
|
+
* The internal date object that stores the target-zone wall-clock fields.
|
|
223
|
+
* Read and write those fields through UTC getters/setters only.
|
|
224
|
+
*
|
|
225
|
+
* @internal
|
|
226
|
+
*/
|
|
5
227
|
internal: Date;
|
|
6
|
-
|
|
7
|
-
|
|
228
|
+
/**
|
|
229
|
+
* Creates a new `TZDateMini` instance in the given time zone.
|
|
230
|
+
*/
|
|
231
|
+
withTimeZone(timeZone: string): TZDateMini;
|
|
232
|
+
getTimezoneOffset(): number;
|
|
233
|
+
setTime(time: number): number;
|
|
234
|
+
/**
|
|
235
|
+
* Creates a new `TZDateMini` instance in the current instance time zone and
|
|
236
|
+
* the specified date time value.
|
|
237
|
+
*
|
|
238
|
+
* @param date - Date value to create a new instance from
|
|
239
|
+
*/
|
|
240
|
+
[constructFromSymbol](date: Date | number | string): TZDateMini;
|
|
8
241
|
}
|
|
9
242
|
//# sourceMappingURL=mini.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mini.d.ts","sourceRoot":"","sources":["../../../../../src/date-fns/tz/src/date/mini.
|
|
1
|
+
{"version":3,"file":"mini.d.ts","sourceRoot":"","sources":["../../../../../src/date-fns/tz/src/date/mini.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,KAAK;AAEL,OAAO,EAAE,mBAAmB,EA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,EACZ,KAAK,EAAE,MAAM,EACb,OAAO,EAAE,MAAM,EACf,OAAO,EAAE,MAAM,GACd,UAAU;IAEb;;;;;;;;;;;;OAYG;IACH,MAAM,CAAC,EAAE,CACP,EAAE,EAAE,MAAM,EACV,IAAI,EAAE,MAAM,EACZ,KAAK,EAAE,MAAM,EACb,IAAI,EAAE,MAAM,EACZ,KAAK,EAAE,MAAM,EACb,OAAO,EAAE,MAAM,EACf,OAAO,EAAE,MAAM,EACf,YAAY,EAAE,MAAM,GACnB,UAAU;IAab;;OAEG;IACH,SAAiB,QAAQ,EAAE,MAAM,GAAG,SAAS,CAAC;IAE9C;;;;;OAKG;IACK,QAAQ,EAAE,IAAI,CAAC;IAEvB;;OAEG;IACH,YAAY,CAAC,QAAQ,EAAE,MAAM,GAAG,UAAU;IAI1C,iBAAiB,IAAI,MAAM;IAW3B,OAAO,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM;IAc7B;;;;;OAKG;IACH,CAAC,mBAAmB,CAAC,CAAC,IAAI,EAAE,IAAI,GAAG,MAAM,GAAG,MAAM,GAAG,UAAU;CAKhE"}
|
|
@@ -4,36 +4,26 @@
|
|
|
4
4
|
*
|
|
5
5
|
* Modified and integrated in "Inray":
|
|
6
6
|
* - Evgeniy Bushin
|
|
7
|
+
* - z.AI, GLM 5.3
|
|
7
8
|
*/
|
|
8
9
|
/***/
|
|
9
|
-
|
|
10
|
+
import { constructFromSymbol } from "../constants/index.js";
|
|
10
11
|
import { tzOffset } from "../tzOffset/index.js";
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
//
|
|
26
|
-
// - `syncToInternal` starts from the external timestamp and rebuilds internal
|
|
27
|
-
// wall-clock fields using `this.timeZone` offset.
|
|
28
|
-
//
|
|
29
|
-
// - `syncFromInternal` starts from internal wall-clock fields, writes them into
|
|
30
|
-
// the external date, then adjusts that timestamp for the system/target offset
|
|
31
|
-
// difference and DST edge cases.
|
|
32
|
-
//
|
|
33
|
-
// The public TZDate value is the combination of both: external is the instant,
|
|
34
|
-
// internal is the wall-clock view of that instant in `this.timeZone`.
|
|
12
|
+
/**
|
|
13
|
+
* Time zone date class. It overrides original Date functions making them
|
|
14
|
+
* to perform all the calculations in the given time zone.
|
|
15
|
+
*
|
|
16
|
+
* It also provides new functions useful when working with time zones.
|
|
17
|
+
*
|
|
18
|
+
* Combined with date-fns, it allows using the class the same way as
|
|
19
|
+
* the original date class.
|
|
20
|
+
*
|
|
21
|
+
* This minimal version provides complete functionality required for date-fns
|
|
22
|
+
* and excludes build-size-heavy formatter functions.
|
|
23
|
+
*
|
|
24
|
+
* For the complete version, see `TZDate`.
|
|
25
|
+
*/
|
|
35
26
|
export class TZDateMini extends Date {
|
|
36
|
-
//#region static
|
|
37
27
|
constructor(...args) {
|
|
38
28
|
super();
|
|
39
29
|
// Time zone string is always the last string argument unless date string
|
|
@@ -43,7 +33,7 @@ export class TZDateMini extends Date {
|
|
|
43
33
|
}
|
|
44
34
|
this.internal = new Date();
|
|
45
35
|
// Validate the time zone by checking its offset.
|
|
46
|
-
if (isNaN(tzOffset(this.timeZone, this))) {
|
|
36
|
+
if (Number.isNaN(tzOffset(this.timeZone, this))) {
|
|
47
37
|
this.setTime(NaN);
|
|
48
38
|
}
|
|
49
39
|
else {
|
|
@@ -66,7 +56,9 @@ export class TZDateMini extends Date {
|
|
|
66
56
|
}
|
|
67
57
|
else {
|
|
68
58
|
// `Date` values passed:
|
|
69
|
-
// Set it as external date.
|
|
59
|
+
// Set it as external date. The spread of the union arguments type
|
|
60
|
+
// can't be verified against the `Date` constructor overloads, so use
|
|
61
|
+
// a permissive constructor type (erased at compile time).
|
|
70
62
|
this.setTime(+new Date(...args));
|
|
71
63
|
// Adjust internal and external dates considering that we might have
|
|
72
64
|
// landed on the DST hour.
|
|
@@ -75,10 +67,14 @@ export class TZDateMini extends Date {
|
|
|
75
67
|
}
|
|
76
68
|
}
|
|
77
69
|
static tz(tz, ...args) {
|
|
78
|
-
|
|
70
|
+
// The constructor overloads can't verify a spread with the appended time
|
|
71
|
+
// zone argument, so use a permissive constructor type instead.
|
|
72
|
+
const construct = TZDateMini;
|
|
73
|
+
return args.length ? new construct(...args, tz) : new construct(Date.now(), tz);
|
|
79
74
|
}
|
|
80
|
-
|
|
81
|
-
|
|
75
|
+
/**
|
|
76
|
+
* Creates a new `TZDateMini` instance in the given time zone.
|
|
77
|
+
*/
|
|
82
78
|
withTimeZone(timeZone) {
|
|
83
79
|
return new TZDateMini(+this, timeZone);
|
|
84
80
|
}
|
|
@@ -90,44 +86,51 @@ export class TZDateMini extends Date {
|
|
|
90
86
|
}
|
|
91
87
|
//#endregion
|
|
92
88
|
//#region time
|
|
93
|
-
setTime(
|
|
89
|
+
setTime(time) {
|
|
94
90
|
// Use the native `setTime` to the external date time.
|
|
95
|
-
Date.prototype.setTime.
|
|
91
|
+
Date.prototype.setTime.call(this, time);
|
|
96
92
|
// Then apply it to the internal date adjusting to the timezone offset.
|
|
97
93
|
syncToInternal(this);
|
|
98
94
|
return +this;
|
|
99
95
|
}
|
|
100
96
|
//#endregion
|
|
101
97
|
//#region date-fns integration
|
|
102
|
-
|
|
98
|
+
/**
|
|
99
|
+
* Creates a new `TZDateMini` instance in the current instance time zone and
|
|
100
|
+
* the specified date time value.
|
|
101
|
+
*
|
|
102
|
+
* @param date - Date value to create a new instance from
|
|
103
|
+
*/
|
|
104
|
+
[constructFromSymbol](date) {
|
|
103
105
|
return new TZDateMini(+new Date(date), this.timeZone);
|
|
104
106
|
}
|
|
105
107
|
}
|
|
106
108
|
// Assign getters and setters
|
|
107
109
|
const re = /^(get|set)(?!UTC)/;
|
|
110
|
+
const proto = TZDateMini.prototype;
|
|
108
111
|
Object.getOwnPropertyNames(Date.prototype).forEach((method) => {
|
|
109
112
|
if (!re.test(method))
|
|
110
113
|
return;
|
|
111
114
|
const utcMethod = method.replace(re, '$1UTC');
|
|
112
115
|
// Filter out methods without UTC counterparts
|
|
113
|
-
if (!
|
|
116
|
+
if (!proto[utcMethod])
|
|
114
117
|
return;
|
|
115
118
|
if (method.startsWith('get')) {
|
|
116
119
|
// Delegate to internal date's UTC method
|
|
117
|
-
|
|
120
|
+
proto[method] = function () {
|
|
118
121
|
return this.internal[utcMethod]();
|
|
119
122
|
};
|
|
120
123
|
}
|
|
121
124
|
else {
|
|
122
125
|
// Assign regular setter
|
|
123
|
-
|
|
124
|
-
Date.prototype[utcMethod].apply(this.internal,
|
|
126
|
+
proto[method] = function (...args) {
|
|
127
|
+
Date.prototype[utcMethod].apply(this.internal, args);
|
|
125
128
|
syncFromInternal(this);
|
|
126
129
|
return +this;
|
|
127
130
|
};
|
|
128
131
|
// Assign UTC setter
|
|
129
|
-
|
|
130
|
-
Date.prototype[utcMethod].apply(this,
|
|
132
|
+
proto[utcMethod] = function (...args) {
|
|
133
|
+
Date.prototype[utcMethod].apply(this, args);
|
|
131
134
|
syncToInternal(this);
|
|
132
135
|
return +this;
|
|
133
136
|
};
|
|
@@ -137,7 +140,7 @@ Object.getOwnPropertyNames(Date.prototype).forEach((method) => {
|
|
|
137
140
|
* @internal
|
|
138
141
|
* Function syncs time to internal date, applying the current time zone offset.
|
|
139
142
|
*
|
|
140
|
-
* @param
|
|
143
|
+
* @param date - `Date` to sync
|
|
141
144
|
*/
|
|
142
145
|
function syncToInternal(date) {
|
|
143
146
|
// Start internal from the same real timestamp as external.
|
|
@@ -160,7 +163,7 @@ function syncToInternal(date) {
|
|
|
160
163
|
* @internal
|
|
161
164
|
* Function syncs internal wall-clock fields into the external date.
|
|
162
165
|
*
|
|
163
|
-
* @param
|
|
166
|
+
* @param date - The date to sync
|
|
164
167
|
*/
|
|
165
168
|
function syncFromInternal(date) {
|
|
166
169
|
// Copy target-zone wall-clock fields from internal into external using native
|
|
@@ -179,7 +182,7 @@ function syncFromInternal(date) {
|
|
|
179
182
|
* We use it when constructing `TZDate` and syncing the external date from
|
|
180
183
|
* the internal one.
|
|
181
184
|
*
|
|
182
|
-
* @param
|
|
185
|
+
* @param date - `TZDate` to adjust.
|
|
183
186
|
*/
|
|
184
187
|
function adjustToSystemTZ(date, constructorArgs) {
|
|
185
188
|
// Keep the intended target-zone wall-clock value before native Date/system
|
|
@@ -227,7 +230,9 @@ function adjustToSystemTZ(date, constructorArgs) {
|
|
|
227
230
|
// Target wall-clock hour currently stored in internal fields. Constructors
|
|
228
231
|
// get it from arguments because internal may have already been synced from
|
|
229
232
|
// the normalized external timestamp; setters get it directly from internal.
|
|
230
|
-
const expectedHour = Array.isArray(constructorArgs)
|
|
233
|
+
const expectedHour = Array.isArray(constructorArgs)
|
|
234
|
+
? constructorArgs[3] || 0
|
|
235
|
+
: date.internal.getUTCHours();
|
|
231
236
|
if (systemHour !== expectedHour) {
|
|
232
237
|
// Check whether using the current system offset would keep the target
|
|
233
238
|
// offset unchanged. If so, the only DST jump we crossed is the system
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mini.js","sourceRoot":"","sources":["../../../../../src/date-fns/tz/src/date/mini.js"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,KAAK;AAEL,cAAc;AAEd,OAAO,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAEhD,0EAA0E;AAC1E,+CAA+C;AAC/C,EAAE;AACF,gFAAgF;AAChF,8EAA8E;AAC9E,gFAAgF;AAChF,8CAA8C;AAC9C,EAAE;AACF,gFAAgF;AAChF,gFAAgF;AAChF,uEAAuE;AACvE,iFAAiF;AACjF,EAAE;AACF,sDAAsD;AACtD,EAAE;AACF,8EAA8E;AAC9E,oDAAoD;AACpD,EAAE;AACF,gFAAgF;AAChF,gFAAgF;AAChF,mCAAmC;AACnC,EAAE;AACF,+EAA+E;AAC/E,sEAAsE;AAEtE,MAAM,OAAO,UAAW,SAAQ,IAAI;IAClC,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,IAAI,CAAC,CAAC;IACvB,CAAC;AACH,CAAC;AAED,SAAS,6BAA6B,CAAC,IAAoB;IACzD,0EAA0E;IAC1E,0EAA0E;IAC1E,oEAAoE;IACpE,OAAO,IAAI,CAAC,GAAG,CACb,IAAI,CAAC,CAAC,CAAW,EACjB,IAAI,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAE,IAAI,CAAC,CAAC,CAAY,CAAC,CAAC,CAAC,CAAC,EACzC,IAAI,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAE,IAAI,CAAC,CAAC,CAAY,CAAC,CAAC,CAAC,CAAC,EACzC,GAAI,IAAI,CAAC,KAAK,CAAC,CAAC,CAA0C,CAC3D,CAAC;AACJ,CAAC;AAED,SAAS,kBAAkB,CAAC,IAAgB,EAAE,IAAa;IACzD,4EAA4E;IAC5E,yEAAyE;IACzE,MAAM,QAAQ,GAAG,IAAI,IAAI,CAAC,IAAI,IAAI,CAAC,IAAI,CAAC,CAAC;IACzC,QAAQ,CAAC,aAAa,CAAC,QAAQ,CAAC,aAAa,EAAE,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC,QAAQ,CAAC,IAAI,CAAC,QAAQ,EAAE,QAAQ,CAAC,GAAG,EAAE,CAAC,CAAC,CAAC;IACvG,OAAO,CAAC,QAAQ,CAAC;AACnB,CAAC"}
|
|
@@ -7,8 +7,8 @@
|
|
|
7
7
|
*/
|
|
8
8
|
/***/
|
|
9
9
|
export * from './constants/index.ts';
|
|
10
|
-
export * from './date/index.
|
|
11
|
-
export * from './date/mini.
|
|
10
|
+
export * from './date/index.ts';
|
|
11
|
+
export * from './date/mini.ts';
|
|
12
12
|
export * from './tz/index.ts';
|
|
13
13
|
export * from './tzName/index.ts';
|
|
14
14
|
export * from './tzOffset/index.ts';
|
|
@@ -7,8 +7,8 @@
|
|
|
7
7
|
*/
|
|
8
8
|
/***/
|
|
9
9
|
export * from "./constants/index.js";
|
|
10
|
-
export * from
|
|
11
|
-
export * from
|
|
10
|
+
export * from "./date/index.js";
|
|
11
|
+
export * from "./date/mini.js";
|
|
12
12
|
export * from "./tz/index.js";
|
|
13
13
|
export * from "./tzName/index.js";
|
|
14
14
|
export * from "./tzOffset/index.js";
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
* - Evgeniy Bushin
|
|
7
7
|
*/
|
|
8
8
|
/***/
|
|
9
|
-
import { TZDate } from '../date/index.
|
|
9
|
+
import { TZDate } from '../date/index.ts';
|
|
10
10
|
/**
|
|
11
11
|
* The function creates accepts a time zone and returns a function that creates
|
|
12
12
|
* a new `TZDate` instance in the time zone from the provided value. Use it to
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
* - Evgeniy Bushin
|
|
7
7
|
*/
|
|
8
8
|
/***/
|
|
9
|
-
import { TZDate } from
|
|
9
|
+
import { TZDate } from "../date/index.js";
|
|
10
10
|
/**
|
|
11
11
|
* The function creates accepts a time zone and returns a function that creates
|
|
12
12
|
* a new `TZDate` instance in the time zone from the provided value. Use it to
|
|
@@ -1,4 +1,12 @@
|
|
|
1
|
-
|
|
1
|
+
/**
|
|
2
|
+
* Original library: date-fns (v4.4.0)
|
|
3
|
+
* - Copyright (c) 2022 Sasha Koss https://kossnocorp.mit-license.org
|
|
4
|
+
*
|
|
5
|
+
* Modified and integrated in "Inray":
|
|
6
|
+
* - Evgeniy Bushin
|
|
7
|
+
*/
|
|
8
|
+
/***/
|
|
9
|
+
import { UTCDateMini } from './mini.ts';
|
|
2
10
|
/**
|
|
3
11
|
* UTC date class. It maps getters and setters to corresponding UTC methods,
|
|
4
12
|
* forcing all calculations in the UTC time zone.
|
|
@@ -10,27 +18,35 @@ declare const UTCDate_base: typeof import("./index.js").UTCDate;
|
|
|
10
18
|
* and `getTimezoneOffset`, but also the formatter functions, mirroring
|
|
11
19
|
* all original `Date` functionality. Use this version when you need to format
|
|
12
20
|
* a string or in an environment you don't fully control (a library).
|
|
21
|
+
*
|
|
13
22
|
* For a minimal version, see `UTCDateMini`.
|
|
14
23
|
*/
|
|
15
|
-
export class UTCDate extends
|
|
24
|
+
export declare class UTCDate extends UTCDateMini {
|
|
25
|
+
/**
|
|
26
|
+
* Returns the string representation of the date.
|
|
27
|
+
*/
|
|
28
|
+
toString(): string;
|
|
29
|
+
/**
|
|
30
|
+
* Returns the date part of the string representation of the date.
|
|
31
|
+
*/
|
|
32
|
+
toDateString(): string;
|
|
33
|
+
/**
|
|
34
|
+
* Returns the time part of the string representation of the date.
|
|
35
|
+
*/
|
|
36
|
+
toTimeString(): string;
|
|
16
37
|
/**
|
|
17
|
-
*
|
|
18
|
-
* @param { Intl.DateTimeFormatOptions } [options]
|
|
19
|
-
* @returns { string }
|
|
38
|
+
* Returns the locale-formatted string representation of the date.
|
|
20
39
|
*/
|
|
21
|
-
toLocaleString(locales?:
|
|
40
|
+
toLocaleString(locales?: string | string[], options?: Intl.DateTimeFormatOptions): string;
|
|
22
41
|
/**
|
|
23
|
-
*
|
|
24
|
-
*
|
|
25
|
-
* @returns { string }
|
|
42
|
+
* Returns the locale-formatted date part of the string representation
|
|
43
|
+
* of the date.
|
|
26
44
|
*/
|
|
27
|
-
toLocaleDateString(locales?:
|
|
45
|
+
toLocaleDateString(locales?: string | string[], options?: Intl.DateTimeFormatOptions): string;
|
|
28
46
|
/**
|
|
29
|
-
*
|
|
30
|
-
*
|
|
31
|
-
* @returns { string }
|
|
47
|
+
* Returns the locale-formatted time part of the string representation
|
|
48
|
+
* of the date.
|
|
32
49
|
*/
|
|
33
|
-
toLocaleTimeString(locales?:
|
|
50
|
+
toLocaleTimeString(locales?: string | string[], options?: Intl.DateTimeFormatOptions): string;
|
|
34
51
|
}
|
|
35
|
-
export {};
|
|
36
52
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/date-fns/utc/src/date/index.
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/date-fns/utc/src/date/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,KAAK;AAEL,OAAO,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AAExC;;;;;;;;;;;;;GAaG;AACH,qBAAa,OAAQ,SAAQ,WAAW;IACtC;;OAEG;IACH,QAAQ,IAAI,MAAM;IAMlB;;OAEG;IACH,YAAY,IAAI,MAAM;IAOtB;;OAEG;IACH,YAAY,IAAI,MAAM;IAKtB;;OAEG;IACH,cAAc,CAAC,OAAO,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,EAAE,OAAO,CAAC,EAAE,IAAI,CAAC,qBAAqB,GAAG,MAAM;IAOzF;;;OAGG;IACH,kBAAkB,CAAC,OAAO,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,EAAE,OAAO,CAAC,EAAE,IAAI,CAAC,qBAAqB,GAAG,MAAM;IAO7F;;;OAGG;IACH,kBAAkB,CAAC,OAAO,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,EAAE,OAAO,CAAC,EAAE,IAAI,CAAC,qBAAqB,GAAG,MAAM;CAM9F"}
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
* - Evgeniy Bushin
|
|
7
7
|
*/
|
|
8
8
|
/***/
|
|
9
|
-
import { UTCDateMini } from
|
|
9
|
+
import { UTCDateMini } from "./mini.js";
|
|
10
10
|
/**
|
|
11
11
|
* UTC date class. It maps getters and setters to corresponding UTC methods,
|
|
12
12
|
* forcing all calculations in the UTC time zone.
|
|
@@ -18,31 +18,36 @@ import { UTCDateMini } from './mini.js';
|
|
|
18
18
|
* and `getTimezoneOffset`, but also the formatter functions, mirroring
|
|
19
19
|
* all original `Date` functionality. Use this version when you need to format
|
|
20
20
|
* a string or in an environment you don't fully control (a library).
|
|
21
|
+
*
|
|
21
22
|
* For a minimal version, see `UTCDateMini`.
|
|
22
23
|
*/
|
|
23
24
|
export class UTCDate extends UTCDateMini {
|
|
24
|
-
/**
|
|
25
|
+
/**
|
|
26
|
+
* Returns the string representation of the date.
|
|
27
|
+
*/
|
|
25
28
|
toString() {
|
|
26
29
|
const date = this.toDateString();
|
|
27
30
|
const time = this.toTimeString();
|
|
28
31
|
return `${date} ${time}`;
|
|
29
32
|
}
|
|
30
|
-
/**
|
|
33
|
+
/**
|
|
34
|
+
* Returns the date part of the string representation of the date.
|
|
35
|
+
*/
|
|
31
36
|
toDateString() {
|
|
32
37
|
const weekday = weekdayFormat.format(this);
|
|
33
38
|
const date = dateFormat.format(this);
|
|
34
39
|
const year = this.getFullYear();
|
|
35
40
|
return `${weekday} ${date} ${year}`;
|
|
36
41
|
}
|
|
37
|
-
/**
|
|
42
|
+
/**
|
|
43
|
+
* Returns the time part of the string representation of the date.
|
|
44
|
+
*/
|
|
38
45
|
toTimeString() {
|
|
39
46
|
const time = timeFormat.format(this);
|
|
40
47
|
return `${time} GMT+0000 (Coordinated Universal Time)`;
|
|
41
48
|
}
|
|
42
49
|
/**
|
|
43
|
-
*
|
|
44
|
-
* @param { Intl.DateTimeFormatOptions } [options]
|
|
45
|
-
* @returns { string }
|
|
50
|
+
* Returns the locale-formatted string representation of the date.
|
|
46
51
|
*/
|
|
47
52
|
toLocaleString(locales, options) {
|
|
48
53
|
return Date.prototype.toLocaleString.call(this, locales, {
|
|
@@ -51,9 +56,8 @@ export class UTCDate extends UTCDateMini {
|
|
|
51
56
|
});
|
|
52
57
|
}
|
|
53
58
|
/**
|
|
54
|
-
*
|
|
55
|
-
*
|
|
56
|
-
* @returns { string }
|
|
59
|
+
* Returns the locale-formatted date part of the string representation
|
|
60
|
+
* of the date.
|
|
57
61
|
*/
|
|
58
62
|
toLocaleDateString(locales, options) {
|
|
59
63
|
return Date.prototype.toLocaleDateString.call(this, locales, {
|
|
@@ -62,9 +66,8 @@ export class UTCDate extends UTCDateMini {
|
|
|
62
66
|
});
|
|
63
67
|
}
|
|
64
68
|
/**
|
|
65
|
-
*
|
|
66
|
-
*
|
|
67
|
-
* @returns { string }
|
|
69
|
+
* Returns the locale-formatted time part of the string representation
|
|
70
|
+
* of the date.
|
|
68
71
|
*/
|
|
69
72
|
toLocaleTimeString(locales, options) {
|
|
70
73
|
return Date.prototype.toLocaleTimeString.call(this, locales, {
|
|
@@ -73,21 +76,20 @@ export class UTCDate extends UTCDateMini {
|
|
|
73
76
|
});
|
|
74
77
|
}
|
|
75
78
|
}
|
|
76
|
-
|
|
79
|
+
const weekdayFormat = new Intl.DateTimeFormat('en-US', {
|
|
77
80
|
weekday: 'short',
|
|
78
81
|
timeZone: 'UTC'
|
|
79
82
|
});
|
|
80
|
-
|
|
83
|
+
const dateFormat = new Intl.DateTimeFormat('en-US', {
|
|
81
84
|
month: 'short',
|
|
82
85
|
day: 'numeric',
|
|
83
86
|
timeZone: 'UTC'
|
|
84
87
|
});
|
|
85
|
-
|
|
88
|
+
const timeFormat = new Intl.DateTimeFormat('en-GB', {
|
|
86
89
|
hour12: false,
|
|
87
90
|
hour: 'numeric',
|
|
88
91
|
minute: 'numeric',
|
|
89
92
|
second: 'numeric',
|
|
90
93
|
timeZone: 'UTC'
|
|
91
94
|
});
|
|
92
|
-
const a = new Date();
|
|
93
95
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/date-fns/utc/src/date/index.
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/date-fns/utc/src/date/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,KAAK;AAEL,OAAO,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AAExC;;;;;;;;;;;;;GAaG;AACH,MAAM,OAAO,OAAQ,SAAQ,WAAW;IACtC;;OAEG;IACH,QAAQ;QACN,MAAM,IAAI,GAAG,IAAI,CAAC,YAAY,EAAE,CAAC;QACjC,MAAM,IAAI,GAAG,IAAI,CAAC,YAAY,EAAE,CAAC;QACjC,OAAO,GAAG,IAAI,IAAI,IAAI,EAAE,CAAC;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CAAC,cAAc,CAAC,OAAO,EAAE;IAClD,KAAK,EAAE,OAAO;IACd,GAAG,EAAE,SAAS;IACd,QAAQ,EAAE,KAAK;CAChB,CAAC,CAAC;AAEH,MAAM,UAAU,GAAG,IAAI,IAAI,CAAC,cAAc,CAAC,OAAO,EAAE;IAClD,MAAM,EAAE,KAAK;IACb,IAAI,EAAE,SAAS;IACf,MAAM,EAAE,SAAS;IACjB,MAAM,EAAE,SAAS;IACjB,QAAQ,EAAE,KAAK;CAChB,CAAC,CAAC"}
|
|
@@ -6,7 +6,23 @@
|
|
|
6
6
|
* - Evgeniy Bushin
|
|
7
7
|
*/
|
|
8
8
|
/***/
|
|
9
|
-
|
|
10
|
-
|
|
9
|
+
/**
|
|
10
|
+
* UTC date class. It maps getters and setters to corresponding UTC methods,
|
|
11
|
+
* forcing all calculations in the UTC time zone.
|
|
12
|
+
*
|
|
13
|
+
* Combined with date-fns, it allows using the class the same way as
|
|
14
|
+
* the original date class.
|
|
15
|
+
*
|
|
16
|
+
* This minimal version provides only getters, setters, and `getTimezoneOffset`,
|
|
17
|
+
* leaving the formatter functions out.
|
|
18
|
+
*
|
|
19
|
+
* For the complete version, see `UTCDate`.
|
|
20
|
+
*/
|
|
21
|
+
export declare class UTCDateMini extends Date {
|
|
22
|
+
constructor();
|
|
23
|
+
constructor(value: number | string);
|
|
24
|
+
constructor(date: Date);
|
|
25
|
+
constructor(year: number, monthIndex: number, date?: number, hours?: number, minutes?: number, seconds?: number, ms?: number);
|
|
26
|
+
getTimezoneOffset(): 0;
|
|
11
27
|
}
|
|
12
28
|
//# sourceMappingURL=mini.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mini.d.ts","sourceRoot":"","sources":["../../../../../src/date-fns/utc/src/date/mini.
|
|
1
|
+
{"version":3,"file":"mini.d.ts","sourceRoot":"","sources":["../../../../../src/date-fns/utc/src/date/mini.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,KAAK;AAWL;;;;;;;;;;;GAWG;AACH,qBAAa,WAAY,SAAQ,IAAI;;gBAEvB,KAAK,EAAE,MAAM,GAAG,MAAM;gBACtB,IAAI,EAAE,IAAI;gBAEpB,IAAI,EAAE,MAAM,EACZ,UAAU,EAAE,MAAM,EAClB,IAAI,CAAC,EAAE,MAAM,EACb,KAAK,CAAC,EAAE,MAAM,EACd,OAAO,CAAC,EAAE,MAAM,EAChB,OAAO,CAAC,EAAE,MAAM,EAChB,EAAE,CAAC,EAAE,MAAM;IAiBb,iBAAiB,IAAI,CAAC;CAGvB"}
|
|
@@ -6,20 +6,29 @@
|
|
|
6
6
|
* - Evgeniy Bushin
|
|
7
7
|
*/
|
|
8
8
|
/***/
|
|
9
|
-
|
|
9
|
+
/**
|
|
10
|
+
* UTC date class. It maps getters and setters to corresponding UTC methods,
|
|
11
|
+
* forcing all calculations in the UTC time zone.
|
|
12
|
+
*
|
|
13
|
+
* Combined with date-fns, it allows using the class the same way as
|
|
14
|
+
* the original date class.
|
|
15
|
+
*
|
|
16
|
+
* This minimal version provides only getters, setters, and `getTimezoneOffset`,
|
|
17
|
+
* leaving the formatter functions out.
|
|
18
|
+
*
|
|
19
|
+
* For the complete version, see `UTCDate`.
|
|
20
|
+
*/
|
|
10
21
|
export class UTCDateMini extends Date {
|
|
11
|
-
constructor() {
|
|
22
|
+
constructor(...args) {
|
|
12
23
|
super();
|
|
13
|
-
this.setTime(
|
|
14
|
-
// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Function/arguments
|
|
15
|
-
arguments.length === 0
|
|
24
|
+
this.setTime(args.length === 0
|
|
16
25
|
? // Enables Vitest/Sinon fake timers that override the constructor
|
|
17
26
|
Date.now()
|
|
18
|
-
:
|
|
19
|
-
? typeof
|
|
20
|
-
? +new Date(
|
|
21
|
-
:
|
|
22
|
-
: Date.UTC(...
|
|
27
|
+
: args.length === 1
|
|
28
|
+
? typeof args[0] === 'string'
|
|
29
|
+
? +new Date(args[0])
|
|
30
|
+
: +args[0]
|
|
31
|
+
: Date.UTC(args[0], args[1], ...args.slice(2)));
|
|
23
32
|
}
|
|
24
33
|
getTimezoneOffset() {
|
|
25
34
|
return 0;
|
|
@@ -27,11 +36,13 @@ export class UTCDateMini extends Date {
|
|
|
27
36
|
}
|
|
28
37
|
// Replace getter and setter functions with UTC counterparts
|
|
29
38
|
const re = /^(get|set)(?!UTC)/;
|
|
39
|
+
const dateProto = Date.prototype;
|
|
40
|
+
const proto = UTCDateMini.prototype;
|
|
30
41
|
Object.getOwnPropertyNames(Date.prototype).forEach((method) => {
|
|
31
42
|
if (re.test(method)) {
|
|
32
|
-
const utcMethod =
|
|
33
|
-
if (utcMethod)
|
|
34
|
-
|
|
43
|
+
const utcMethod = method.replace(re, '$1UTC');
|
|
44
|
+
if (dateProto[utcMethod])
|
|
45
|
+
proto[method] = dateProto[utcMethod];
|
|
35
46
|
}
|
|
36
47
|
});
|
|
37
48
|
//# sourceMappingURL=mini.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mini.js","sourceRoot":"","sources":["../../../../../src/date-fns/utc/src/date/mini.
|
|
1
|
+
{"version":3,"file":"mini.js","sourceRoot":"","sources":["../../../../../src/date-fns/utc/src/date/mini.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,KAAK;AAWL;;;;;;;;;;;GAWG;AACH,MAAM,OAAO,WAAY,SAAQ,IAAI;IAanC,YAAY,GAAG,IAAqB;QAClC,KAAK,EAAE,CAAC;QAER,IAAI,CAAC,OAAO,CACV,IAAI,CAAC,MAAM,KAAK,CAAC;YACf,CAAC,CAAC,iEAAiE;gBACjE,IAAI,CAAC,GAAG,EAAE;YACZ,CAAC,CAAC,IAAI,CAAC,MAAM,KAAK,CAAC;gBACjB,CAAC,CAAC,OAAO,IAAI,CAAC,CAAC,CAAC,KAAK,QAAQ;oBAC3B,CAAC,CAAC,CAAC,IAAI,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;oBACpB,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAE;gBACb,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,CAAE,EAAE,IAAI,CAAC,CAAC,CAAE,EAAE,GAAI,IAAI,CAAC,KAAK,CAAC,CAAC,CAAmD,CAAC,CACxG,CAAC;IACJ,CAAC;IAED,iBAAiB;QACf,OAAO,CAAC,CAAC;IACX,CAAC;CACF;AAED,4DAA4D;AAC5D,MAAM,EAAE,GAAG,mBAAmB,CAAC;AAC/B,MAAM,SAAS,GAAG,IAAI,CAAC,SAA+C,CAAC;AACvE,MAAM,KAAK,GAAG,WAAW,CAAC,SAA+C,CAAC;AAC1E,MAAM,CAAC,mBAAmB,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC,OAAO,CAAC,CAAC,MAAM,EAAE,EAAE;IAC5D,IAAI,EAAE,CAAC,IAAI,CAAC,MAAM,CAAC,EAAE,CAAC;QACpB,MAAM,SAAS,GAAG,MAAM,CAAC,OAAO,CAAC,EAAE,EAAE,OAAO,CAAC,CAAC;QAC9C,IAAI,SAAS,CAAC,SAAS,CAAC;YAAE,KAAK,CAAC,MAAM,CAAC,GAAG,SAAS,CAAC,SAAS,CAAC,CAAC;IACjE,CAAC;AACH,CAAC,CAAC,CAAC"}
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
* - Evgeniy Bushin
|
|
7
7
|
*/
|
|
8
8
|
/***/
|
|
9
|
-
import { UTCDate } from '../date/index.
|
|
9
|
+
import { UTCDate } from '../date/index.ts';
|
|
10
10
|
/**
|
|
11
11
|
* The function creates a new `UTCDate` instance from the provided value. Use it
|
|
12
12
|
* to provide the context for the date-fns functions, via the `in` option.
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
* - Evgeniy Bushin
|
|
7
7
|
*/
|
|
8
8
|
/***/
|
|
9
|
-
import { UTCDate } from
|
|
9
|
+
import { UTCDate } from "../date/index.js";
|
|
10
10
|
/**
|
|
11
11
|
* The function creates a new `UTCDate` instance from the provided value. Use it
|
|
12
12
|
* to provide the context for the date-fns functions, via the `in` option.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "inray",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.1",
|
|
4
4
|
"description": "Inray SDK",
|
|
5
5
|
"private": false,
|
|
6
6
|
"type": "module",
|
|
@@ -79,8 +79,8 @@
|
|
|
79
79
|
"import": "./dist/caching/mod.js"
|
|
80
80
|
},
|
|
81
81
|
"./caching/keyv": {
|
|
82
|
-
"types": "./dist/caching/keyValue/index.d.ts",
|
|
83
|
-
"import": "./dist/caching/keyValue/index.js"
|
|
82
|
+
"types": "./dist/caching/src/keyValue/index.d.ts",
|
|
83
|
+
"import": "./dist/caching/src/keyValue/index.js"
|
|
84
84
|
},
|
|
85
85
|
"./cli": {
|
|
86
86
|
"types": "./dist/cli/mod.d.ts",
|
|
@@ -693,6 +693,9 @@
|
|
|
693
693
|
"typescript": "^6.0.3",
|
|
694
694
|
"undici": "^7.30.0",
|
|
695
695
|
"vitest": "^4.1.11",
|
|
696
|
-
"ws": "^8.21.3"
|
|
696
|
+
"ws": "^8.21.3",
|
|
697
|
+
"date-fns": "4.4.0",
|
|
698
|
+
"@date-fns/utc": "2.1.1",
|
|
699
|
+
"@date-fns/tz": "1.5.0"
|
|
697
700
|
}
|
|
698
701
|
}
|