@sprucelabs/calendar-utils 41.0.0 → 41.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.
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { TimezoneName } from '../types/calendar.types';
|
|
1
|
+
import { DurationUtil, TimezoneName } from '../types/calendar.types';
|
|
2
2
|
export default class DurationUtilBuilder {
|
|
3
3
|
static durationUtil: {
|
|
4
4
|
dates: {
|
|
@@ -52,6 +52,7 @@ export default class DurationUtilBuilder {
|
|
|
52
52
|
renderDateTimeUntil(beginning: number, end: number, prefixes?: Partial<import("./duration.utility").TimeUntilOptions> | undefined): string;
|
|
53
53
|
renderTimeRange(date1: number, date2: number): string;
|
|
54
54
|
};
|
|
55
|
+
static lastBuiltDurationUtil?: DurationUtil;
|
|
55
56
|
static getForTimezone(timezone: TimezoneName): Promise<{
|
|
56
57
|
dates: {
|
|
57
58
|
eventDaysOfWeek: {
|
|
@@ -18,6 +18,7 @@ class DurationUtilBuilder {
|
|
|
18
18
|
yield locale.setZoneName(timezone);
|
|
19
19
|
const durationUtilCopy = Object.assign({}, this.durationUtil);
|
|
20
20
|
durationUtilCopy.dates = new DateUtilDecorator(locale).makeLocaleAware(dateUtil);
|
|
21
|
+
this.lastBuiltDurationUtil = durationUtilCopy;
|
|
21
22
|
return durationUtilCopy;
|
|
22
23
|
});
|
|
23
24
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { TimezoneName } from '../types/calendar.types';
|
|
1
|
+
import { DurationUtil, TimezoneName } from '../types/calendar.types';
|
|
2
2
|
export default class DurationUtilBuilder {
|
|
3
3
|
static durationUtil: {
|
|
4
4
|
dates: {
|
|
@@ -52,6 +52,7 @@ export default class DurationUtilBuilder {
|
|
|
52
52
|
renderDateTimeUntil(beginning: number, end: number, prefixes?: Partial<import("./duration.utility").TimeUntilOptions> | undefined): string;
|
|
53
53
|
renderTimeRange(date1: number, date2: number): string;
|
|
54
54
|
};
|
|
55
|
+
static lastBuiltDurationUtil?: DurationUtil;
|
|
55
56
|
static getForTimezone(timezone: TimezoneName): Promise<{
|
|
56
57
|
dates: {
|
|
57
58
|
eventDaysOfWeek: {
|
|
@@ -13,6 +13,7 @@ class DurationUtilBuilder {
|
|
|
13
13
|
await locale.setZoneName(timezone);
|
|
14
14
|
const durationUtilCopy = { ...this.durationUtil };
|
|
15
15
|
durationUtilCopy.dates = new DateUtilDecorator_1.default(locale).makeLocaleAware(date_utility_1.default);
|
|
16
|
+
this.lastBuiltDurationUtil = durationUtilCopy;
|
|
16
17
|
return durationUtilCopy;
|
|
17
18
|
}
|
|
18
19
|
static reset() {
|