@eliasrrosa/tutorhub-public-assets 0.0.11 → 0.0.13
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.
|
@@ -5,6 +5,7 @@ import { IFile } from "./File";
|
|
|
5
5
|
import { IGoogleCalendarEvent } from "./GoogleCalendarEvent";
|
|
6
6
|
import { IPayment } from "./Payment";
|
|
7
7
|
import { IRescheduleRequest } from "./RescheduleRequest";
|
|
8
|
+
import { ITime } from "./Time";
|
|
8
9
|
export interface IClass {
|
|
9
10
|
id: string;
|
|
10
11
|
groupId: string | null;
|
|
@@ -13,8 +14,8 @@ export interface IClass {
|
|
|
13
14
|
createdAt: Date | null;
|
|
14
15
|
updatedAt: Date | null;
|
|
15
16
|
date: IDate;
|
|
16
|
-
time:
|
|
17
|
-
endTime:
|
|
17
|
+
time: ITime;
|
|
18
|
+
endTime: ITime;
|
|
18
19
|
endDate: IDate | null;
|
|
19
20
|
courseId: string;
|
|
20
21
|
paymentId: string | null;
|
|
@@ -37,8 +38,8 @@ export declare class Class implements IClass {
|
|
|
37
38
|
createdAt: Date | null;
|
|
38
39
|
updatedAt: Date | null;
|
|
39
40
|
date: IDate;
|
|
40
|
-
time:
|
|
41
|
-
endTime:
|
|
41
|
+
time: ITime;
|
|
42
|
+
endTime: ITime;
|
|
42
43
|
endDate: IDate | null;
|
|
43
44
|
courseId: string;
|
|
44
45
|
paymentId: string | null;
|
|
@@ -60,8 +61,8 @@ export declare class Class implements IClass {
|
|
|
60
61
|
createdAt?: Date | null;
|
|
61
62
|
updatedAt?: Date | null;
|
|
62
63
|
date: IDate;
|
|
63
|
-
time:
|
|
64
|
-
endTime:
|
|
64
|
+
time: ITime;
|
|
65
|
+
endTime: ITime;
|
|
65
66
|
endDate?: IDate | null;
|
|
66
67
|
courseId: string;
|
|
67
68
|
paymentId?: string | null;
|
|
@@ -13,8 +13,8 @@ import { ITime } from "./Time";
|
|
|
13
13
|
export declare class ISO8601Time implements ITime {
|
|
14
14
|
readonly originalTimeString: string;
|
|
15
15
|
readonly timeValidator: IISO8601TimeValidator;
|
|
16
|
-
readonly
|
|
17
|
-
readonly
|
|
16
|
+
readonly timezoneConverter: IISO8601TimezoneConverter;
|
|
17
|
+
readonly timezoneParser: IISO8601TimezoneParser;
|
|
18
18
|
/**
|
|
19
19
|
* Throws if format is invalid.
|
|
20
20
|
* Accepted formats: HH:MM:SS, HH:MM, HH:MM:SS(+|-)HH:MM, HH:MM:SS.sssZ and HH:MM:SSZ.
|
|
@@ -19,8 +19,8 @@ class ISO8601Time {
|
|
|
19
19
|
*/
|
|
20
20
|
constructor(value) {
|
|
21
21
|
this.timeValidator = new ISO8601TimeValidator_1.ISO8601TimeValidator();
|
|
22
|
-
this.
|
|
23
|
-
this.
|
|
22
|
+
this.timezoneConverter = new ISO8601TimezoneConverter_1.ISO8601TimezoneConverter();
|
|
23
|
+
this.timezoneParser = new ISO8601TimezoneParser_1.ISO8601TimezoneParser();
|
|
24
24
|
this.getNowTimeString = ISO8601Time.getNow;
|
|
25
25
|
this.getTimezone = () => {
|
|
26
26
|
return new ISO8601Timezone_1.ISO8601Timezone(this.originalTimeString);
|
|
@@ -50,7 +50,7 @@ class ISO8601Time {
|
|
|
50
50
|
.selector.getTimezoneString(timeWithAddedHours.originalTimeString)}`);
|
|
51
51
|
};
|
|
52
52
|
this.addTimezone = (timezone) => {
|
|
53
|
-
const newTimezone = typeof timezone == "number" ? this.
|
|
53
|
+
const newTimezone = typeof timezone == "number" ? this.timezoneParser.toString(timezone) : timezone;
|
|
54
54
|
return new ISO8601Time(`${this.getHoursString()}:${this.getMinutesString()}:${this.getSecondsString()}${newTimezone}`);
|
|
55
55
|
};
|
|
56
56
|
this.originalTimeString = value ? value : this.getNowTimeString();
|
|
@@ -1,8 +1,12 @@
|
|
|
1
1
|
import { IISO8601Timezone } from "./ISO8601Timezone";
|
|
2
|
+
import { IISO8601TimezoneConverter } from "./ISO8601TimezoneConverter";
|
|
3
|
+
import { IISO8601TimezoneParser } from "./ISO8601TimezoneParser";
|
|
2
4
|
import { ITimeValidator } from "./TimeValidator";
|
|
3
5
|
export interface ITime {
|
|
4
6
|
originalTimeString: string;
|
|
5
7
|
timeValidator: ITimeValidator;
|
|
8
|
+
timezoneConverter: IISO8601TimezoneConverter;
|
|
9
|
+
timezoneParser: IISO8601TimezoneParser;
|
|
6
10
|
/**
|
|
7
11
|
* returns time string in chosen format. Default is `HH:MM`.
|
|
8
12
|
*
|
package/dist/index.cjs
CHANGED
|
@@ -434,8 +434,8 @@ var ISO8601Time = class _ISO8601Time {
|
|
|
434
434
|
*/
|
|
435
435
|
constructor(value) {
|
|
436
436
|
this.timeValidator = new ISO8601TimeValidator();
|
|
437
|
-
this.
|
|
438
|
-
this.
|
|
437
|
+
this.timezoneConverter = new ISO8601TimezoneConverter();
|
|
438
|
+
this.timezoneParser = new ISO8601TimezoneParser();
|
|
439
439
|
this.getNowTimeString = _ISO8601Time.getNow;
|
|
440
440
|
this.getTimezone = () => {
|
|
441
441
|
return new ISO8601Timezone(this.originalTimeString);
|
|
@@ -467,7 +467,7 @@ var ISO8601Time = class _ISO8601Time {
|
|
|
467
467
|
);
|
|
468
468
|
};
|
|
469
469
|
this.addTimezone = (timezone) => {
|
|
470
|
-
const newTimezone = typeof timezone == "number" ? this.
|
|
470
|
+
const newTimezone = typeof timezone == "number" ? this.timezoneParser.toString(timezone) : timezone;
|
|
471
471
|
return new _ISO8601Time(
|
|
472
472
|
`${this.getHoursString()}:${this.getMinutesString()}:${this.getSecondsString()}${newTimezone}`
|
|
473
473
|
);
|