@dereekb/date 9.24.47 → 9.25.0
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/CHANGELOG.md +9 -0
- package/package.json +2 -2
- package/src/lib/date/date.block.d.ts +373 -16
- package/src/lib/date/date.block.day.d.ts +1 -0
- package/src/lib/date/date.block.day.js +1 -0
- package/src/lib/date/date.block.day.js.map +1 -1
- package/src/lib/date/date.block.js +236 -24
- package/src/lib/date/date.block.js.map +1 -1
- package/src/lib/date/{date.validator.d.ts → date.block.validator.d.ts} +6 -0
- package/src/lib/date/{date.validator.js → date.block.validator.js} +7 -1
- package/src/lib/date/date.block.validator.js.map +1 -0
- package/src/lib/date/date.block.week.d.ts +24 -0
- package/src/lib/date/date.block.week.js +12 -0
- package/src/lib/date/date.block.week.js.map +1 -1
- package/src/lib/date/date.cell.d.ts +357 -0
- package/src/lib/date/date.cell.factory.d.ts +337 -0
- package/src/lib/date/date.cell.factory.js +479 -0
- package/src/lib/date/date.cell.factory.js.map +1 -0
- package/src/lib/date/date.cell.filter.d.ts +18 -0
- package/src/lib/date/date.cell.filter.js +65 -0
- package/src/lib/date/date.cell.filter.js.map +1 -0
- package/src/lib/date/date.cell.index.d.ts +375 -0
- package/src/lib/date/date.cell.index.js +731 -0
- package/src/lib/date/date.cell.index.js.map +1 -0
- package/src/lib/date/date.cell.js +518 -0
- package/src/lib/date/date.cell.js.map +1 -0
- package/src/lib/date/date.cell.schedule.d.ts +409 -0
- package/src/lib/date/date.cell.schedule.day.d.ts +9 -0
- package/src/lib/date/date.cell.schedule.day.js +15 -0
- package/src/lib/date/date.cell.schedule.day.js.map +1 -0
- package/src/lib/date/date.cell.schedule.js +667 -0
- package/src/lib/date/date.cell.schedule.js.map +1 -0
- package/src/lib/date/date.cell.validator.d.ts +14 -0
- package/src/lib/date/date.cell.validator.js +67 -0
- package/src/lib/date/date.cell.validator.js.map +1 -0
- package/src/lib/date/date.cell.week.d.ts +31 -0
- package/src/lib/date/date.cell.week.js +40 -0
- package/src/lib/date/date.cell.week.js.map +1 -0
- package/src/lib/date/date.d.ts +18 -0
- package/src/lib/date/date.duration.d.ts +2 -1
- package/src/lib/date/date.duration.js +6 -1
- package/src/lib/date/date.duration.js.map +1 -1
- package/src/lib/date/date.format.js +2 -1
- package/src/lib/date/date.format.js.map +1 -1
- package/src/lib/date/date.js +29 -1
- package/src/lib/date/date.js.map +1 -1
- package/src/lib/date/date.range.d.ts +4 -2
- package/src/lib/date/date.range.js +6 -4
- package/src/lib/date/date.range.js.map +1 -1
- package/src/lib/date/date.range.timezone.d.ts +27 -6
- package/src/lib/date/date.range.timezone.js +21 -7
- package/src/lib/date/date.range.timezone.js.map +1 -1
- package/src/lib/date/date.schedule.d.ts +99 -0
- package/src/lib/date/date.schedule.js +63 -0
- package/src/lib/date/date.schedule.js.map +1 -1
- package/src/lib/date/date.time.js +3 -3
- package/src/lib/date/date.time.js.map +1 -1
- package/src/lib/date/date.timezone.d.ts +98 -3
- package/src/lib/date/date.timezone.js +191 -24
- package/src/lib/date/date.timezone.js.map +1 -1
- package/src/lib/date/date.week.js +2 -0
- package/src/lib/date/date.week.js.map +1 -1
- package/src/lib/date/index.d.ts +8 -1
- package/src/lib/date/index.js +8 -1
- package/src/lib/date/index.js.map +1 -1
- package/src/lib/expires/expires.js +1 -1
- package/src/lib/expires/expires.js.map +1 -1
- package/src/lib/timezone/index.d.ts +1 -0
- package/src/lib/timezone/index.js +1 -0
- package/src/lib/timezone/index.js.map +1 -1
- package/src/lib/timezone/timezone.d.ts +7 -0
- package/src/lib/timezone/timezone.js +14 -2
- package/src/lib/timezone/timezone.js.map +1 -1
- package/src/lib/timezone/timezone.validator.d.ts +6 -0
- package/src/lib/timezone/timezone.validator.js +26 -0
- package/src/lib/timezone/timezone.validator.js.map +1 -0
- package/src/lib/date/date.validator.js.map +0 -1
|
@@ -12,9 +12,11 @@ const class_transformer_1 = require("class-transformer");
|
|
|
12
12
|
const date_timezone_1 = require("./date.timezone");
|
|
13
13
|
const class_validator_1 = require("class-validator");
|
|
14
14
|
const date_format_1 = require("./date.format");
|
|
15
|
+
const date_range_timezone_1 = require("./date.range.timezone");
|
|
15
16
|
/**
|
|
16
17
|
* Returns true if the index is a non-negative integer.
|
|
17
18
|
*
|
|
19
|
+
* @deprecated use DateCell implementation instead.
|
|
18
20
|
* @param input
|
|
19
21
|
*/
|
|
20
22
|
function isValidDateBlockIndex(input) {
|
|
@@ -38,6 +40,7 @@ exports.DateBlock = DateBlock;
|
|
|
38
40
|
/**
|
|
39
41
|
* Converts the input number or DateBlock to a DateBlock.
|
|
40
42
|
*
|
|
43
|
+
* @deprecated use DateCell implementation instead.
|
|
41
44
|
* @param dateBlockOrIndex
|
|
42
45
|
* @returns
|
|
43
46
|
*/
|
|
@@ -49,10 +52,14 @@ exports.dateBlock = dateBlock;
|
|
|
49
52
|
* The maximum number of hours that a DateBlockTiming's start can be offset. This means a max timezone of UTC+12.
|
|
50
53
|
*
|
|
51
54
|
* The timezones UTC+13 and UTC+14 are not supported, and will experience undetermined behavior.
|
|
55
|
+
*
|
|
56
|
+
* @deprecated use DateCell implementation instead.
|
|
52
57
|
*/
|
|
53
58
|
exports.MAX_DATE_BLOCK_TIMING_OFFSET_HOURS = 12;
|
|
54
59
|
/**
|
|
55
60
|
* The minimum number of hours that a DateBlockTiming's start can be offset. This means a min timezone of UTC-12.
|
|
61
|
+
*
|
|
62
|
+
* @deprecated use DateCell implementation instead.
|
|
56
63
|
*/
|
|
57
64
|
exports.MIN_DATE_BLOCK_TIMING_OFFSET_HOURS = -12;
|
|
58
65
|
class DateBlockTiming extends date_duration_1.DateDurationSpan {
|
|
@@ -76,10 +83,16 @@ tslib_1.__decorate([
|
|
|
76
83
|
(0, class_transformer_1.Type)(() => Date),
|
|
77
84
|
tslib_1.__metadata("design:type", Date)
|
|
78
85
|
], DateBlockTiming.prototype, "end", void 0);
|
|
86
|
+
tslib_1.__decorate([
|
|
87
|
+
(0, class_transformer_1.Expose)(),
|
|
88
|
+
(0, class_validator_1.IsOptional)(),
|
|
89
|
+
tslib_1.__metadata("design:type", String)
|
|
90
|
+
], DateBlockTiming.prototype, "timezone", void 0);
|
|
79
91
|
exports.DateBlockTiming = DateBlockTiming;
|
|
80
92
|
/**
|
|
81
93
|
* Returns true if the two timings are equivalent.
|
|
82
94
|
*
|
|
95
|
+
* @deprecated use DateCell implementation instead.
|
|
83
96
|
* @param a
|
|
84
97
|
* @param b
|
|
85
98
|
*/
|
|
@@ -90,6 +103,7 @@ exports.isSameDateBlockTiming = isSameDateBlockTiming;
|
|
|
90
103
|
/**
|
|
91
104
|
* Returns the date range from the start of the first event to the end time of the last event.
|
|
92
105
|
*
|
|
106
|
+
* @deprecated use DateCell implementation instead.
|
|
93
107
|
* @param timing
|
|
94
108
|
* @returns
|
|
95
109
|
*/
|
|
@@ -100,6 +114,7 @@ exports.dateBlockTimingFullRange = dateBlockTimingFullRange;
|
|
|
100
114
|
/**
|
|
101
115
|
* Returns the date range from the start of the first event to the end time of the last event.
|
|
102
116
|
*
|
|
117
|
+
* @deprecated use DateCell implementation instead.
|
|
103
118
|
* @param timing
|
|
104
119
|
* @returns
|
|
105
120
|
*/
|
|
@@ -107,6 +122,12 @@ function dateBlockTimingEventRange(timing) {
|
|
|
107
122
|
return { start: timing.startsAt, end: timing.end };
|
|
108
123
|
}
|
|
109
124
|
exports.dateBlockTimingEventRange = dateBlockTimingEventRange;
|
|
125
|
+
/**
|
|
126
|
+
*
|
|
127
|
+
* @deprecated use DateCell implementation instead.
|
|
128
|
+
* @param timing
|
|
129
|
+
* @returns
|
|
130
|
+
*/
|
|
110
131
|
function getCurrentDateBlockTimingUtcData(timing) {
|
|
111
132
|
const start = timing.start;
|
|
112
133
|
const dateHours = start.getUTCHours();
|
|
@@ -122,6 +143,7 @@ exports.getCurrentDateBlockTimingUtcData = getCurrentDateBlockTimingUtcData;
|
|
|
122
143
|
/**
|
|
123
144
|
* The offset in milliseconds to the "real start date", the first second in the target day on in the system timezone.
|
|
124
145
|
*
|
|
146
|
+
* @deprecated use DateCell implementation instead.
|
|
125
147
|
* @param timing
|
|
126
148
|
*/
|
|
127
149
|
function getCurrentDateBlockTimingOffsetData(timing) {
|
|
@@ -140,10 +162,22 @@ function getCurrentDateBlockTimingOffsetData(timing) {
|
|
|
140
162
|
};
|
|
141
163
|
}
|
|
142
164
|
exports.getCurrentDateBlockTimingOffsetData = getCurrentDateBlockTimingOffsetData;
|
|
165
|
+
/**
|
|
166
|
+
*
|
|
167
|
+
* @deprecated use DateCell implementation instead.
|
|
168
|
+
* @param timing
|
|
169
|
+
* @returns
|
|
170
|
+
*/
|
|
143
171
|
function getCurrentDateBlockTimingOffset(timing) {
|
|
144
172
|
return getCurrentDateBlockTimingOffsetData(timing).offset;
|
|
145
173
|
}
|
|
146
174
|
exports.getCurrentDateBlockTimingOffset = getCurrentDateBlockTimingOffset;
|
|
175
|
+
/**
|
|
176
|
+
*
|
|
177
|
+
* @deprecated use DateCell implementation instead.
|
|
178
|
+
* @param timezone
|
|
179
|
+
* @returns
|
|
180
|
+
*/
|
|
147
181
|
function timingIsInExpectedTimezoneFunction(timezone) {
|
|
148
182
|
const normal = (0, date_timezone_1.dateTimezoneUtcNormal)(timezone);
|
|
149
183
|
return (timing) => {
|
|
@@ -154,6 +188,13 @@ function timingIsInExpectedTimezoneFunction(timezone) {
|
|
|
154
188
|
};
|
|
155
189
|
}
|
|
156
190
|
exports.timingIsInExpectedTimezoneFunction = timingIsInExpectedTimezoneFunction;
|
|
191
|
+
/**
|
|
192
|
+
*
|
|
193
|
+
* @deprecated use DateCell implementation instead.
|
|
194
|
+
* @param timing
|
|
195
|
+
* @param timezone
|
|
196
|
+
* @returns
|
|
197
|
+
*/
|
|
157
198
|
function timingIsInExpectedTimezone(timing, timezone) {
|
|
158
199
|
return timingIsInExpectedTimezoneFunction(timezone)(timing);
|
|
159
200
|
}
|
|
@@ -165,12 +206,13 @@ exports.timingIsInExpectedTimezone = timingIsInExpectedTimezone;
|
|
|
165
206
|
* @returns
|
|
166
207
|
*/
|
|
167
208
|
function getDateBlockTimingFirstEventDateRange(timing) {
|
|
168
|
-
return (0,
|
|
209
|
+
return (0, date_range_timezone_1.fitDateRangeToDayPeriod)({ start: timing.startsAt, end: timing.end });
|
|
169
210
|
}
|
|
170
211
|
exports.getDateBlockTimingFirstEventDateRange = getDateBlockTimingFirstEventDateRange;
|
|
171
212
|
/**
|
|
172
213
|
* Returns the fractional hours in the event.
|
|
173
214
|
*
|
|
215
|
+
* @deprecated use DateCell implementation instead.
|
|
174
216
|
* @param timing
|
|
175
217
|
* @returns
|
|
176
218
|
*/
|
|
@@ -182,6 +224,7 @@ exports.getDateBlockTimingHoursInEvent = getDateBlockTimingHoursInEvent;
|
|
|
182
224
|
/**
|
|
183
225
|
* Creates a DateTimezoneUtcNormalInstance from the input.
|
|
184
226
|
*
|
|
227
|
+
* @deprecated use DateCell implementation instead.
|
|
185
228
|
* @param input
|
|
186
229
|
* @returns
|
|
187
230
|
*/
|
|
@@ -194,6 +237,7 @@ exports.timingDateTimezoneUtcNormal = timingDateTimezoneUtcNormal;
|
|
|
194
237
|
/**
|
|
195
238
|
* Convenience function that extends timingDateTimezoneUtcNormal() but also asserts the that the timing matches it.
|
|
196
239
|
*
|
|
240
|
+
* @deprecated use DateCell implementation instead.
|
|
197
241
|
* @param input
|
|
198
242
|
* @param timing
|
|
199
243
|
* @returns
|
|
@@ -206,12 +250,12 @@ function assertedTimingDateTimezoneUtcNormal(input, timing) {
|
|
|
206
250
|
return timezoneInstance;
|
|
207
251
|
}
|
|
208
252
|
exports.assertedTimingDateTimezoneUtcNormal = assertedTimingDateTimezoneUtcNormal;
|
|
209
|
-
function dateBlockTimingFromDateRangeAndEvent(dateBlockTimingStartEndRange, event
|
|
253
|
+
function dateBlockTimingFromDateRangeAndEvent(dateBlockTimingStartEndRange, event) {
|
|
210
254
|
const { start, end } = dateBlockTimingStartEndRange;
|
|
211
255
|
const { startsAt: eventStartsAt, duration } = event;
|
|
212
256
|
// need the timezone instance to compute against the normal and convert to the system time, before going back.
|
|
213
257
|
// this is necessary because the start is a timezone normal for UTC, and the minutes need to be converted back properly adjusting for timezones.
|
|
214
|
-
const timezoneInstance =
|
|
258
|
+
const timezoneInstance = timingDateTimezoneUtcNormal(dateBlockTimingStartEndRange);
|
|
215
259
|
// compute startsAt, the start time for the first event
|
|
216
260
|
const startsAt = (0, date_timezone_1.copyHoursAndMinutesFromDateWithTimezoneNormal)(start, eventStartsAt, timezoneInstance);
|
|
217
261
|
const timing = {
|
|
@@ -226,13 +270,20 @@ exports.dateBlockTimingFromDateRangeAndEvent = dateBlockTimingFromDateRangeAndEv
|
|
|
226
270
|
function safeDateBlockTimingFromDateRangeAndEvent(dateBlockTimingStartEndRange, event, timezone) {
|
|
227
271
|
const { start, end } = dateBlockTimingStartEndRange;
|
|
228
272
|
const timezoneInstance = assertedTimingDateTimezoneUtcNormal(timezone !== null && timezone !== void 0 ? timezone : dateBlockTimingStartEndRange, dateBlockTimingStartEndRange);
|
|
229
|
-
const
|
|
230
|
-
const
|
|
231
|
-
const endDay = timezoneInstance.targetDateToSystemDate(endNormal); // get the end of the day
|
|
273
|
+
// const startDayFactory = dateBlockTimingStartDateFactory({ start }, timezoneInstance);
|
|
274
|
+
const endDay = end; // get midnight of the day the job usually ends at
|
|
232
275
|
const endDayDateRange = { start, endDay };
|
|
233
276
|
return _dateBlockTimingFromDateBlockTimingStartEndDayDateRange(endDayDateRange, event, timezoneInstance);
|
|
234
277
|
}
|
|
235
278
|
exports.safeDateBlockTimingFromDateRangeAndEvent = safeDateBlockTimingFromDateRangeAndEvent;
|
|
279
|
+
/**
|
|
280
|
+
* Converts a DateBlockTimingStartEndDayDateRange and DateBlockTimingEvent to a DateBlockTiming. The event is used to derive the startsAt, duration and end time. The timezone offset is retained.
|
|
281
|
+
*
|
|
282
|
+
* @deprecated use DateCell implementation instead.
|
|
283
|
+
* @param dateBlockTimingStartEndDayDateRange
|
|
284
|
+
* @param event
|
|
285
|
+
* @returns
|
|
286
|
+
*/
|
|
236
287
|
function dateBlockTimingFromDateBlockTimingStartEndDayDateRange(dateBlockTimingStartEndDayDateRange, event, timezone) {
|
|
237
288
|
// need the timezone instance to compute against the normal and convert to the system time, before going back.
|
|
238
289
|
// this is necessary because the start is a timezone normal for UTC, and the minutes need to be converted back properly adjusting for timezones.
|
|
@@ -246,6 +297,7 @@ exports.dateBlockTimingFromDateBlockTimingStartEndDayDateRange = dateBlockTiming
|
|
|
246
297
|
*
|
|
247
298
|
* See dateBlockTimingFromDateBlockTimingStartEndDayDateRange() for details.
|
|
248
299
|
*
|
|
300
|
+
* @deprecated use DateCell implementation instead.
|
|
249
301
|
* @param dateBlockTimingStartEndDayDateRange
|
|
250
302
|
* @param event
|
|
251
303
|
* @param timezoneInstance
|
|
@@ -257,18 +309,21 @@ function _dateBlockTimingFromDateBlockTimingStartEndDayDateRange(dateBlockTiming
|
|
|
257
309
|
// compute startsAt, the start time for the first event
|
|
258
310
|
const startsAt = (0, date_timezone_1.copyHoursAndMinutesFromDateWithTimezoneNormal)(start, eventStartsAt, timezoneInstance);
|
|
259
311
|
// compute end, the end time for the last event using the last day
|
|
260
|
-
const
|
|
312
|
+
const lastDayStartsAt = dateBlockTimingStartsAtDateFactory({ start, startsAt }, timezoneInstance)(endDay);
|
|
313
|
+
const end = (0, date_fns_1.addMinutes)(lastDayStartsAt, duration);
|
|
261
314
|
const timing = {
|
|
262
315
|
start,
|
|
263
316
|
end,
|
|
264
317
|
startsAt,
|
|
265
318
|
duration
|
|
266
319
|
};
|
|
320
|
+
// console.log({ timezoneInstance, startsAt, eventStartsAt, lastDayStartsAt, dateBlockTimingStartEndDayDateRange, event, timing });
|
|
267
321
|
return timing;
|
|
268
322
|
}
|
|
269
323
|
/**
|
|
270
324
|
* Creates a ChangeTimingToTimezoneFunction from the input.
|
|
271
325
|
*
|
|
326
|
+
* @deprecated use DateCell implementation instead.
|
|
272
327
|
* @param input
|
|
273
328
|
* @returns
|
|
274
329
|
*/
|
|
@@ -285,14 +340,32 @@ function changeTimingToTimezoneFunction(input) {
|
|
|
285
340
|
return fn;
|
|
286
341
|
}
|
|
287
342
|
exports.changeTimingToTimezoneFunction = changeTimingToTimezoneFunction;
|
|
343
|
+
/**
|
|
344
|
+
*
|
|
345
|
+
* @deprecated use DateCell implementation instead.
|
|
346
|
+
* @param timing
|
|
347
|
+
* @param timezone
|
|
348
|
+
* @returns
|
|
349
|
+
*/
|
|
288
350
|
function changeTimingToTimezone(timing, timezone) {
|
|
289
351
|
return changeTimingToTimezoneFunction(timezone)(timing);
|
|
290
352
|
}
|
|
291
353
|
exports.changeTimingToTimezone = changeTimingToTimezone;
|
|
354
|
+
/**
|
|
355
|
+
*
|
|
356
|
+
* @deprecated use DateCell implementation instead.
|
|
357
|
+
* @param timing
|
|
358
|
+
* @returns
|
|
359
|
+
*/
|
|
292
360
|
function changeTimingToSystemTimezone(timing) {
|
|
293
361
|
return changeTimingToTimezoneFunction(date_timezone_1.SYSTEM_DATE_TIMEZONE_UTC_NORMAL_INSTANCE)(timing);
|
|
294
362
|
}
|
|
295
363
|
exports.changeTimingToSystemTimezone = changeTimingToSystemTimezone;
|
|
364
|
+
/**
|
|
365
|
+
*
|
|
366
|
+
* @deprecated use DateCell implementation instead.
|
|
367
|
+
* @returns
|
|
368
|
+
*/
|
|
296
369
|
function dateBlockTimingStartForNowInSystemTimezone() {
|
|
297
370
|
return {
|
|
298
371
|
start: (0, date_fns_1.startOfDay)(new Date())
|
|
@@ -313,6 +386,7 @@ exports.dateBlockTimingStartForNowInTimezone = dateBlockTimingStartForNowInTimez
|
|
|
313
386
|
/**
|
|
314
387
|
* Returns the start date in the current/system timezone for the given date.
|
|
315
388
|
*
|
|
389
|
+
* @deprecated use DateCell implementation instead.
|
|
316
390
|
* @param timing
|
|
317
391
|
*/
|
|
318
392
|
function getCurrentDateBlockTimingStartDate(timing) {
|
|
@@ -320,6 +394,12 @@ function getCurrentDateBlockTimingStartDate(timing) {
|
|
|
320
394
|
return (0, date_fns_1.addMilliseconds)(timing.start, offset);
|
|
321
395
|
}
|
|
322
396
|
exports.getCurrentDateBlockTimingStartDate = getCurrentDateBlockTimingStartDate;
|
|
397
|
+
/**
|
|
398
|
+
*
|
|
399
|
+
* @deprecated use DateCell implementation instead.
|
|
400
|
+
* @param date
|
|
401
|
+
* @returns
|
|
402
|
+
*/
|
|
323
403
|
function isValidDateBlockTimingStartDate(date) {
|
|
324
404
|
return (0, date_fns_1.getMinutes)(date) === 0 && (0, date_fns_1.getSeconds)(date) === 0 && (0, date_fns_1.getMilliseconds)(date) === 0;
|
|
325
405
|
}
|
|
@@ -327,6 +407,7 @@ exports.isValidDateBlockTimingStartDate = isValidDateBlockTimingStartDate;
|
|
|
327
407
|
/**
|
|
328
408
|
* Returns true if the input is a DateBlockTimingRelativeIndexFactory.
|
|
329
409
|
*
|
|
410
|
+
* @deprecated use DateCell implementation instead.
|
|
330
411
|
* @param input
|
|
331
412
|
* @returns
|
|
332
413
|
*/
|
|
@@ -337,6 +418,7 @@ exports.isDateBlockTimingRelativeIndexFactory = isDateBlockTimingRelativeIndexFa
|
|
|
337
418
|
/**
|
|
338
419
|
* Creates a DateBlockTimingRelativeIndexFactory from the input.
|
|
339
420
|
*
|
|
421
|
+
* @deprecated use DateCell implementation instead.
|
|
340
422
|
* @param input
|
|
341
423
|
* @returns
|
|
342
424
|
*/
|
|
@@ -378,6 +460,7 @@ exports.dateBlockTimingRelativeIndexFactory = dateBlockTimingRelativeIndexFactor
|
|
|
378
460
|
/**
|
|
379
461
|
* Creates a DateBlockTimingRelativeIndexArrayFactory from the input DateBlockTimingRelativeIndexFactory.
|
|
380
462
|
*
|
|
463
|
+
* @deprecated use DateCell implementation instead.
|
|
381
464
|
* @param indexFactory
|
|
382
465
|
*/
|
|
383
466
|
function dateBlockTimingRelativeIndexArrayFactory(indexFactory) {
|
|
@@ -409,6 +492,7 @@ exports.dateBlockTimingRelativeIndexArrayFactory = dateBlockTimingRelativeIndexA
|
|
|
409
492
|
/**
|
|
410
493
|
* Gets the relative index of the input date compared to the input timing.
|
|
411
494
|
*
|
|
495
|
+
* @deprecated use DateCell implementation instead.
|
|
412
496
|
* @param timing
|
|
413
497
|
* @param date
|
|
414
498
|
*/
|
|
@@ -419,6 +503,7 @@ exports.getRelativeIndexForDateBlockTiming = getRelativeIndexForDateBlockTiming;
|
|
|
419
503
|
/**
|
|
420
504
|
* Computes a GetNextDateBlockTimingIndexResult from the input.
|
|
421
505
|
*
|
|
506
|
+
* @deprecated use DateCell implementation instead.
|
|
422
507
|
* @param input
|
|
423
508
|
*/
|
|
424
509
|
function getNextDateBlockTimingIndex(input) {
|
|
@@ -461,6 +546,7 @@ exports.getNextDateBlockTimingIndex = getNextDateBlockTimingIndex;
|
|
|
461
546
|
/**
|
|
462
547
|
* Returns the DateRelativeState for the given index and range.
|
|
463
548
|
*
|
|
549
|
+
* @deprecated use DateCell implementation instead.
|
|
464
550
|
* @param nowIndex
|
|
465
551
|
* @param range
|
|
466
552
|
*/
|
|
@@ -482,6 +568,7 @@ exports.dateRelativeStateForDateBlockRangeComparedToIndex = dateRelativeStateFor
|
|
|
482
568
|
/**
|
|
483
569
|
* Creates a DateBlockTimingDateFactory.
|
|
484
570
|
*
|
|
571
|
+
* @deprecated use DateCell implementation instead.
|
|
485
572
|
* @param timing
|
|
486
573
|
* @returns
|
|
487
574
|
*/
|
|
@@ -511,6 +598,7 @@ exports.dateBlockTimingDateFactory = dateBlockTimingDateFactory;
|
|
|
511
598
|
/**
|
|
512
599
|
* Creates a DateBlockTimingDateFactory. The timezone is required to properly compute the accurate startsAt date for locations that experience daylight savings.
|
|
513
600
|
*
|
|
601
|
+
* @deprecated use DateCell implementation instead.
|
|
514
602
|
* @param timing
|
|
515
603
|
* @returns
|
|
516
604
|
*/
|
|
@@ -531,19 +619,18 @@ function dateBlockTimingStartDateFactory(input, timezone) {
|
|
|
531
619
|
return factory;
|
|
532
620
|
}
|
|
533
621
|
exports.dateBlockTimingStartDateFactory = dateBlockTimingStartDateFactory;
|
|
534
|
-
|
|
535
|
-
* Creates a DateBlockTimingStartsAtDateFactory.
|
|
536
|
-
*
|
|
537
|
-
* @param timing
|
|
538
|
-
* @returns
|
|
539
|
-
*/
|
|
540
|
-
function dateBlockTimingStartsAtDateFactory(input) {
|
|
622
|
+
function dateBlockTimingStartsAtDateFactory(input, timezone) {
|
|
541
623
|
const indexFactory = dateBlockTimingRelativeIndexFactory(input);
|
|
542
|
-
const { startsAt: baseTimingStartsAt } = indexFactory._timing;
|
|
624
|
+
const { start, startsAt: baseTimingStartsAt } = indexFactory._timing;
|
|
625
|
+
const timezoneInstance = timingDateTimezoneUtcNormal(timezone !== null && timezone !== void 0 ? timezone : { start });
|
|
626
|
+
if (timezoneInstance.config.assertTimingMatchesTimezone !== false && !timingIsInExpectedTimezone(indexFactory._timing, timezoneInstance)) {
|
|
627
|
+
throw new Error(`unexpected timezone "${timezone}" for start date "${indexFactory._timing.start}" for dateBlockTimingStartsAtDateFactory(). Is expected to match the timezones.`);
|
|
628
|
+
}
|
|
629
|
+
const baseStartsAtInUtc = timezoneInstance.baseDateToTargetDate(baseTimingStartsAt);
|
|
543
630
|
const factory = ((input) => {
|
|
544
631
|
const index = indexFactory(input); // get the index
|
|
545
|
-
const
|
|
546
|
-
return
|
|
632
|
+
const startAtInUtc = (0, date_fns_1.addHours)(baseStartsAtInUtc, index * util_1.HOURS_IN_DAY);
|
|
633
|
+
return timezoneInstance.targetDateToBaseDate(startAtInUtc);
|
|
547
634
|
});
|
|
548
635
|
factory._indexFactory = indexFactory;
|
|
549
636
|
return factory;
|
|
@@ -552,6 +639,7 @@ exports.dateBlockTimingStartsAtDateFactory = dateBlockTimingStartsAtDateFactory;
|
|
|
552
639
|
/**
|
|
553
640
|
* Returns the date of the input index.
|
|
554
641
|
*
|
|
642
|
+
* @deprecated use DateCell implementation instead.
|
|
555
643
|
* @param timing
|
|
556
644
|
* @param date
|
|
557
645
|
*/
|
|
@@ -572,6 +660,8 @@ exports.getRelativeDateForDateBlockTiming = getRelativeDateForDateBlockTiming;
|
|
|
572
660
|
* The end date is used just to determine the number of days, but a minimum of 1 day is always enforced as a DateBlockTiming must contain atleast 1 day.
|
|
573
661
|
*
|
|
574
662
|
* The start date from the inputDate is considered to to have the offset noted in DateBlock, and will be retained.
|
|
663
|
+
*
|
|
664
|
+
* @deprecated use DateCell implementation instead.
|
|
575
665
|
*/
|
|
576
666
|
function dateBlockTiming(durationInput, inputRange, options) {
|
|
577
667
|
const { duration } = durationInput;
|
|
@@ -617,9 +707,12 @@ function dateBlockTiming(durationInput, inputRange, options) {
|
|
|
617
707
|
// numberOfBlockedDays = numberOfBlockedDays - 1; // reduce number of applied days by 1
|
|
618
708
|
}
|
|
619
709
|
const start = range.start;
|
|
620
|
-
|
|
710
|
+
let lastStart = (0, date_fns_1.addDays)(startsAt, numberOfBlockedDays); // add days so the system can change for daylight savings
|
|
711
|
+
if (timezoneInstance) {
|
|
712
|
+
startsAt = timezoneInstance.targetDateToSystemDate(startsAt);
|
|
713
|
+
lastStart = timezoneInstance.targetDateToSystemDate(lastStart); // may be affected by daylight savings
|
|
714
|
+
}
|
|
621
715
|
// calculate end to be the ending date/time of the final duration span
|
|
622
|
-
const lastStart = (0, date_fns_1.addDays)(startsAt, numberOfBlockedDays);
|
|
623
716
|
const end = (0, date_fns_1.addMinutes)(lastStart, duration);
|
|
624
717
|
return {
|
|
625
718
|
start,
|
|
@@ -629,6 +722,12 @@ function dateBlockTiming(durationInput, inputRange, options) {
|
|
|
629
722
|
};
|
|
630
723
|
}
|
|
631
724
|
exports.dateBlockTiming = dateBlockTiming;
|
|
725
|
+
/**
|
|
726
|
+
*
|
|
727
|
+
* @deprecated use DateCell implementation instead.
|
|
728
|
+
* @param input
|
|
729
|
+
* @returns
|
|
730
|
+
*/
|
|
632
731
|
function dateBlockTimingInTimezoneFunction(input) {
|
|
633
732
|
const changeTimezoneFunction = changeTimingToTimezoneFunction(input);
|
|
634
733
|
const fn = ((durationInput, inputRange) => {
|
|
@@ -639,12 +738,26 @@ function dateBlockTimingInTimezoneFunction(input) {
|
|
|
639
738
|
return fn;
|
|
640
739
|
}
|
|
641
740
|
exports.dateBlockTimingInTimezoneFunction = dateBlockTimingInTimezoneFunction;
|
|
741
|
+
/**
|
|
742
|
+
*
|
|
743
|
+
* @deprecated use DateCell implementation instead.
|
|
744
|
+
* @param durationInput
|
|
745
|
+
* @param inputRange
|
|
746
|
+
* @param timezone
|
|
747
|
+
* @returns
|
|
748
|
+
*/
|
|
642
749
|
function dateBlockTimingInTimezone(durationInput, inputRange, timezone) {
|
|
643
750
|
return dateBlockTimingInTimezoneFunction(timezone)(durationInput, inputRange);
|
|
644
751
|
}
|
|
645
752
|
exports.dateBlockTimingInTimezone = dateBlockTimingInTimezone;
|
|
646
|
-
|
|
647
|
-
|
|
753
|
+
/**
|
|
754
|
+
*
|
|
755
|
+
* @deprecated use DateCell implementation instead.
|
|
756
|
+
* @param timing
|
|
757
|
+
* @returns
|
|
758
|
+
*/
|
|
759
|
+
function isValidDateBlockTimingInfo(timing) {
|
|
760
|
+
const { end, start, startsAt, duration, timezone } = timing;
|
|
648
761
|
const { currentTimezoneOffsetInHours: startOffsetInHours // offset as computed on the given date.
|
|
649
762
|
} = getCurrentDateBlockTimingOffsetData(timing);
|
|
650
763
|
const isStartRoundedToSeconds = start.getMilliseconds() === 0; // should have no milliseconds specified
|
|
@@ -657,6 +770,7 @@ function isValidDateBlockTimingInfo(timing, timezone) {
|
|
|
657
770
|
let isValid = false;
|
|
658
771
|
let isExpectedValidEnd = false;
|
|
659
772
|
let isPlausiblyValidEnd = false;
|
|
773
|
+
let isTimezoneValidatedEnd = false;
|
|
660
774
|
if (isStartRoundedToSeconds &&
|
|
661
775
|
endIsAfterTheStartsAtTime && // end must be after the startsAt time
|
|
662
776
|
durationLessThan24Hours &&
|
|
@@ -667,12 +781,17 @@ function isValidDateBlockTimingInfo(timing, timezone) {
|
|
|
667
781
|
const endOffset = (0, date_timezone_1.getCurrentSystemOffsetInHours)(timing.end);
|
|
668
782
|
const timezoneOffsetDelta = endOffset - startOffsetInHours;
|
|
669
783
|
const expectedFinalStartTime = (0, date_fns_1.addHours)((0, date_fns_1.addMinutes)(end, -duration), timezoneOffsetDelta);
|
|
670
|
-
const
|
|
784
|
+
const finalMsDifference = (0, date_fns_1.differenceInMilliseconds)(startsAt, expectedFinalStartTime);
|
|
785
|
+
const hoursDifference = Math.abs((finalMsDifference % util_1.MS_IN_DAY) / util_1.MS_IN_HOUR);
|
|
786
|
+
const difference = hoursDifference === 23 ? -1 : hoursDifference; // depending on daylight savings, may be off by 1 hour
|
|
671
787
|
isExpectedValidEnd = difference === 0;
|
|
672
|
-
isPlausiblyValidEnd = isExpectedValidEnd || Math.abs(difference) ===
|
|
788
|
+
isPlausiblyValidEnd = isExpectedValidEnd || Math.abs(difference) === 1;
|
|
673
789
|
isValid = isPlausiblyValidEnd;
|
|
790
|
+
if (isPlausiblyValidEnd && timezone) {
|
|
791
|
+
// TODO: validate properly for the timezone...
|
|
792
|
+
}
|
|
674
793
|
}
|
|
675
|
-
|
|
794
|
+
const result = {
|
|
676
795
|
isValid,
|
|
677
796
|
isStartRoundedToSeconds,
|
|
678
797
|
msDifference,
|
|
@@ -684,10 +803,12 @@ function isValidDateBlockTimingInfo(timing, timezone) {
|
|
|
684
803
|
isExpectedValidEnd,
|
|
685
804
|
isPlausiblyValidEnd
|
|
686
805
|
};
|
|
806
|
+
return result;
|
|
687
807
|
}
|
|
688
808
|
exports.isValidDateBlockTimingInfo = isValidDateBlockTimingInfo;
|
|
689
809
|
/**
|
|
690
810
|
*
|
|
811
|
+
* @deprecated use DateCell implementation instead.
|
|
691
812
|
* @param timing
|
|
692
813
|
* @returns
|
|
693
814
|
*/
|
|
@@ -699,6 +820,7 @@ exports.isValidDateBlockTiming = isValidDateBlockTiming;
|
|
|
699
820
|
/**
|
|
700
821
|
* Creates a DateBlockDayOfWeekFactory
|
|
701
822
|
*
|
|
823
|
+
* @deprecated use DateCell implementation instead.
|
|
702
824
|
* @param dayForIndexZero
|
|
703
825
|
* @returns
|
|
704
826
|
*/
|
|
@@ -710,6 +832,7 @@ exports.dateBlockDayOfWeekFactory = dateBlockDayOfWeekFactory;
|
|
|
710
832
|
/**
|
|
711
833
|
* Convenience function for calling expandDateBlocks() with the input DateBlockCollection.
|
|
712
834
|
*
|
|
835
|
+
* @deprecated use DateCell implementation instead.
|
|
713
836
|
* @param collection
|
|
714
837
|
* @returns
|
|
715
838
|
*/
|
|
@@ -720,6 +843,7 @@ exports.expandDateBlockCollection = expandDateBlockCollection;
|
|
|
720
843
|
/**
|
|
721
844
|
* Convenience function for calling dateBlocksExpansionFactory() then passing the blocks.
|
|
722
845
|
*
|
|
846
|
+
* @deprecated use DateCell implementation instead.
|
|
723
847
|
* @param blocks
|
|
724
848
|
* @param timing
|
|
725
849
|
* @returns
|
|
@@ -731,6 +855,7 @@ exports.expandDateBlocks = expandDateBlocks;
|
|
|
731
855
|
/**
|
|
732
856
|
* Creates a DateBlocksExpansionFactory
|
|
733
857
|
*
|
|
858
|
+
* @deprecated use DateCell implementation instead.
|
|
734
859
|
* @param config
|
|
735
860
|
* @returns
|
|
736
861
|
*/
|
|
@@ -782,6 +907,12 @@ function dateBlocksExpansionFactory(config) {
|
|
|
782
907
|
};
|
|
783
908
|
}
|
|
784
909
|
exports.dateBlocksExpansionFactory = dateBlocksExpansionFactory;
|
|
910
|
+
/**
|
|
911
|
+
*
|
|
912
|
+
* @deprecated use DateCell implementation instead.
|
|
913
|
+
* @param config
|
|
914
|
+
* @returns
|
|
915
|
+
*/
|
|
785
916
|
function dateBlockDayTimingInfoFactory(config) {
|
|
786
917
|
const { timing, rangeLimit } = config;
|
|
787
918
|
const { duration } = timing;
|
|
@@ -821,11 +952,23 @@ function dateBlockDayTimingInfoFactory(config) {
|
|
|
821
952
|
};
|
|
822
953
|
}
|
|
823
954
|
exports.dateBlockDayTimingInfoFactory = dateBlockDayTimingInfoFactory;
|
|
955
|
+
/**
|
|
956
|
+
*
|
|
957
|
+
* @deprecated use DateCell implementation instead.
|
|
958
|
+
* @param range
|
|
959
|
+
* @returns
|
|
960
|
+
*/
|
|
824
961
|
function dateBlockRangeToDateBlockIndexRange(range) {
|
|
825
962
|
var _a;
|
|
826
963
|
return { minIndex: range.i, maxIndex: ((_a = range.to) !== null && _a !== void 0 ? _a : range.i) + 1 };
|
|
827
964
|
}
|
|
828
965
|
exports.dateBlockRangeToDateBlockIndexRange = dateBlockRangeToDateBlockIndexRange;
|
|
966
|
+
/**
|
|
967
|
+
*
|
|
968
|
+
* @deprecated use DateCell implementation instead.
|
|
969
|
+
* @param range
|
|
970
|
+
* @returns
|
|
971
|
+
*/
|
|
829
972
|
function dateBlockIndexRangeToDateBlockRange(range) {
|
|
830
973
|
return { i: range.minIndex, to: range.maxIndex - 1 };
|
|
831
974
|
}
|
|
@@ -835,6 +978,7 @@ exports.dateBlockIndexRangeToDateBlockRange = dateBlockIndexRangeToDateBlockRang
|
|
|
835
978
|
*
|
|
836
979
|
* An arbitrary limit can also be applied.
|
|
837
980
|
*
|
|
981
|
+
* @deprecated use DateCell implementation instead.
|
|
838
982
|
* @param timing
|
|
839
983
|
* @param limit
|
|
840
984
|
* @param fitToTimingRange
|
|
@@ -863,6 +1007,7 @@ exports.dateBlockIndexRange = dateBlockIndexRange;
|
|
|
863
1007
|
/**
|
|
864
1008
|
* Returns blocks that are only in the given DateBlockRange.
|
|
865
1009
|
*
|
|
1010
|
+
* @deprecated use DateCell implementation instead.
|
|
866
1011
|
* @param blocks
|
|
867
1012
|
* @param range
|
|
868
1013
|
* @returns
|
|
@@ -872,6 +1017,12 @@ function filterDateBlocksInDateBlockRange(blocks, range) {
|
|
|
872
1017
|
return blocks.filter(dateBlockIsWithinDateBlockRange);
|
|
873
1018
|
}
|
|
874
1019
|
exports.filterDateBlocksInDateBlockRange = filterDateBlocksInDateBlockRange;
|
|
1020
|
+
/**
|
|
1021
|
+
*
|
|
1022
|
+
* @deprecated use DateCell implementation instead.
|
|
1023
|
+
* @param inputRange
|
|
1024
|
+
* @returns
|
|
1025
|
+
*/
|
|
875
1026
|
function isDateBlockWithinDateBlockRangeFunction(inputRange) {
|
|
876
1027
|
const range = dateBlockRangeWithRange(inputRange);
|
|
877
1028
|
return (input) => {
|
|
@@ -890,6 +1041,7 @@ exports.isDateBlockWithinDateBlockRangeFunction = isDateBlockWithinDateBlockRang
|
|
|
890
1041
|
/**
|
|
891
1042
|
* Returns true if the first DateBlock or DateBlockRange contains the second input.
|
|
892
1043
|
*
|
|
1044
|
+
* @deprecated use DateCell implementation instead.
|
|
893
1045
|
* @param range
|
|
894
1046
|
* @param isContainedWithin
|
|
895
1047
|
* @returns
|
|
@@ -898,6 +1050,12 @@ function isDateBlockWithinDateBlockRange(range, contains) {
|
|
|
898
1050
|
return isDateBlockWithinDateBlockRangeFunction(range)(dateBlockRangeWithRange(contains));
|
|
899
1051
|
}
|
|
900
1052
|
exports.isDateBlockWithinDateBlockRange = isDateBlockWithinDateBlockRange;
|
|
1053
|
+
/**
|
|
1054
|
+
*
|
|
1055
|
+
* @deprecated use DateCell implementation instead.
|
|
1056
|
+
* @param config
|
|
1057
|
+
* @returns
|
|
1058
|
+
*/
|
|
901
1059
|
function isDateWithinDateBlockRangeFunction(config) {
|
|
902
1060
|
const { start: inputStart, range: inputRange } = config;
|
|
903
1061
|
let start = inputStart;
|
|
@@ -957,6 +1115,10 @@ function isDateWithinDateBlockRangeFunction(config) {
|
|
|
957
1115
|
};
|
|
958
1116
|
}
|
|
959
1117
|
exports.isDateWithinDateBlockRangeFunction = isDateWithinDateBlockRangeFunction;
|
|
1118
|
+
/**
|
|
1119
|
+
*
|
|
1120
|
+
* @deprecated use DateCell implementation instead.
|
|
1121
|
+
*/
|
|
960
1122
|
class DateBlockRange extends DateBlock {
|
|
961
1123
|
constructor(template) {
|
|
962
1124
|
super(template);
|
|
@@ -976,6 +1138,7 @@ exports.DateBlockRange = DateBlockRange;
|
|
|
976
1138
|
/**
|
|
977
1139
|
* Returns true if the input is a valid DateBlockRange.
|
|
978
1140
|
*
|
|
1141
|
+
* @deprecated use DateCell implementation instead.
|
|
979
1142
|
* @param input
|
|
980
1143
|
* @returns
|
|
981
1144
|
*/
|
|
@@ -993,6 +1156,7 @@ exports.isValidDateBlockRange = isValidDateBlockRange;
|
|
|
993
1156
|
/**
|
|
994
1157
|
* Returns true if the input is a sorted DateBlockRange array and there are no repeat indexes.
|
|
995
1158
|
*
|
|
1159
|
+
* @deprecated use DateCell implementation instead.
|
|
996
1160
|
* @param input
|
|
997
1161
|
* @returns
|
|
998
1162
|
*/
|
|
@@ -1022,6 +1186,8 @@ exports.isValidDateBlockRangeSeries = isValidDateBlockRangeSeries;
|
|
|
1022
1186
|
* Returns the lowest index between all the input date block ranges. Returns 0 by default if there is no minimum or input blocks.
|
|
1023
1187
|
*
|
|
1024
1188
|
* The input range is not expected to be sorted.
|
|
1189
|
+
*
|
|
1190
|
+
* @deprecated use DateCell implementation instead.
|
|
1025
1191
|
*/
|
|
1026
1192
|
function getLeastDateBlockIndexInDateBlockRanges(input) {
|
|
1027
1193
|
var _a, _b;
|
|
@@ -1032,6 +1198,8 @@ exports.getLeastDateBlockIndexInDateBlockRanges = getLeastDateBlockIndexInDateBl
|
|
|
1032
1198
|
* Returns the largest index between all the input date block ranges. Returns 0 by default.
|
|
1033
1199
|
*
|
|
1034
1200
|
* The input range is not expected to be sorted.
|
|
1201
|
+
*
|
|
1202
|
+
* @deprecated use DateCell implementation instead.
|
|
1035
1203
|
*/
|
|
1036
1204
|
function getGreatestDateBlockIndexInDateBlockRanges(input) {
|
|
1037
1205
|
var _a, _b;
|
|
@@ -1042,6 +1210,8 @@ exports.getGreatestDateBlockIndexInDateBlockRanges = getGreatestDateBlockIndexIn
|
|
|
1042
1210
|
* Returns the largest index between all the input date block ranges. Returns null if the input is empty.
|
|
1043
1211
|
*
|
|
1044
1212
|
* The input range is not expected to be sorted.
|
|
1213
|
+
*
|
|
1214
|
+
* @deprecated use DateCell implementation instead.
|
|
1045
1215
|
*/
|
|
1046
1216
|
function getLeastAndGreatestDateBlockIndexInDateBlockRanges(input) {
|
|
1047
1217
|
if (!input.length) {
|
|
@@ -1075,6 +1245,7 @@ exports.getLeastAndGreatestDateBlockIndexInDateBlockRanges = getLeastAndGreatest
|
|
|
1075
1245
|
/**
|
|
1076
1246
|
* Creates a DateBlockRange
|
|
1077
1247
|
*
|
|
1248
|
+
* @deprecated use DateCell implementation instead.
|
|
1078
1249
|
* @param i
|
|
1079
1250
|
* @param to
|
|
1080
1251
|
* @returns
|
|
@@ -1086,6 +1257,7 @@ exports.dateBlockRange = dateBlockRange;
|
|
|
1086
1257
|
/**
|
|
1087
1258
|
* Creates a DateBlockRangeWithRange from the input DateBlockIndex.
|
|
1088
1259
|
*
|
|
1260
|
+
* @deprecated use DateCell implementation instead.
|
|
1089
1261
|
* @param dateBlockIndex
|
|
1090
1262
|
* @returns
|
|
1091
1263
|
*/
|
|
@@ -1096,6 +1268,7 @@ exports.dateBlockRangeWithRangeFromIndex = dateBlockRangeWithRangeFromIndex;
|
|
|
1096
1268
|
/**
|
|
1097
1269
|
* Creates a DateBlockRangeWithRange from the input DateBlockIndex, DateBlock, or DateBlockRange.
|
|
1098
1270
|
*
|
|
1271
|
+
* @deprecated use DateCell implementation instead.
|
|
1099
1272
|
* @param input
|
|
1100
1273
|
* @returns
|
|
1101
1274
|
*/
|
|
@@ -1111,6 +1284,7 @@ exports.dateBlockRangeWithRange = dateBlockRangeWithRange;
|
|
|
1111
1284
|
/**
|
|
1112
1285
|
* Creates a DateBlockRangeIncludedByRangeFunction
|
|
1113
1286
|
*
|
|
1287
|
+
* @deprecated use DateCell implementation instead.
|
|
1114
1288
|
* @param inputRange
|
|
1115
1289
|
* @returns
|
|
1116
1290
|
*/
|
|
@@ -1126,6 +1300,7 @@ exports.dateBlockRangeIncludedByRangeFunction = dateBlockRangeIncludedByRangeFun
|
|
|
1126
1300
|
/**
|
|
1127
1301
|
* Creates a DateBlockRangeOverlapsRangeFunction
|
|
1128
1302
|
*
|
|
1303
|
+
* @deprecated use DateCell implementation instead.
|
|
1129
1304
|
* @param inputRange
|
|
1130
1305
|
* @returns
|
|
1131
1306
|
*/
|
|
@@ -1141,6 +1316,7 @@ exports.dateBlockRangeOverlapsRangeFunction = dateBlockRangeOverlapsRangeFunctio
|
|
|
1141
1316
|
/**
|
|
1142
1317
|
* Returns true if either of the ranges overlap eachother.
|
|
1143
1318
|
*
|
|
1319
|
+
* @deprecated use DateCell implementation instead.
|
|
1144
1320
|
* @param rangeA
|
|
1145
1321
|
* @param rangeB
|
|
1146
1322
|
* @returns
|
|
@@ -1154,6 +1330,7 @@ exports.dateBlockRangeOverlapsRange = dateBlockRangeOverlapsRange;
|
|
|
1154
1330
|
*
|
|
1155
1331
|
* In many cases sortAscendingIndexNumberRefFunction may be preferential since
|
|
1156
1332
|
*
|
|
1333
|
+
* @deprecated use DateCell implementation instead.
|
|
1157
1334
|
* @returns
|
|
1158
1335
|
*/
|
|
1159
1336
|
function sortDateBlockRangeAndSizeFunction() {
|
|
@@ -1163,6 +1340,7 @@ exports.sortDateBlockRangeAndSizeFunction = sortDateBlockRangeAndSizeFunction;
|
|
|
1163
1340
|
/**
|
|
1164
1341
|
* Sorts the input date ranges. This will retain the before/after order while also sorting items by index.
|
|
1165
1342
|
*
|
|
1343
|
+
* @deprecated use DateCell implementation instead.
|
|
1166
1344
|
* @param input
|
|
1167
1345
|
* @returns
|
|
1168
1346
|
*/
|
|
@@ -1173,6 +1351,7 @@ exports.sortDateBlockRanges = sortDateBlockRanges;
|
|
|
1173
1351
|
/**
|
|
1174
1352
|
* Groups the input values into DateBlockRange values.
|
|
1175
1353
|
*
|
|
1354
|
+
* @deprecated use DateCell implementation instead.
|
|
1176
1355
|
* @param input
|
|
1177
1356
|
*/
|
|
1178
1357
|
function groupToDateBlockRanges(input) {
|
|
@@ -1211,6 +1390,8 @@ function groupToDateBlockRanges(input) {
|
|
|
1211
1390
|
exports.groupToDateBlockRanges = groupToDateBlockRanges;
|
|
1212
1391
|
/**
|
|
1213
1392
|
* Returns an array containing all indexes in the date block range.
|
|
1393
|
+
*
|
|
1394
|
+
* @deprecated use DateCell implementation instead.
|
|
1214
1395
|
*/
|
|
1215
1396
|
function allIndexesInDateBlockRange(input) {
|
|
1216
1397
|
return input.to != null ? (0, util_1.range)(input.i, input.to + 1) : [input.i];
|
|
@@ -1219,6 +1400,7 @@ exports.allIndexesInDateBlockRange = allIndexesInDateBlockRange;
|
|
|
1219
1400
|
/**
|
|
1220
1401
|
* Returns the set of all indexes within the input.
|
|
1221
1402
|
*
|
|
1403
|
+
* @deprecated use DateCell implementation instead.
|
|
1222
1404
|
* @param input
|
|
1223
1405
|
* @returns
|
|
1224
1406
|
*/
|
|
@@ -1239,6 +1421,7 @@ exports.allIndexesInDateBlockRanges = allIndexesInDateBlockRanges;
|
|
|
1239
1421
|
/**
|
|
1240
1422
|
* Counts the number of blocks in the input range.
|
|
1241
1423
|
*
|
|
1424
|
+
* @deprecated use DateCell implementation instead.
|
|
1242
1425
|
* @param inputDateBlockRange
|
|
1243
1426
|
* @returns
|
|
1244
1427
|
*/
|
|
@@ -1262,6 +1445,7 @@ exports.dateBlockRangeBlocksCountInfo = dateBlockRangeBlocksCountInfo;
|
|
|
1262
1445
|
/**
|
|
1263
1446
|
* Counts the number of blocks in the input range.
|
|
1264
1447
|
*
|
|
1448
|
+
* @deprecated use DateCell implementation instead.
|
|
1265
1449
|
* @param inputDateBlockRange
|
|
1266
1450
|
* @returns
|
|
1267
1451
|
*/
|
|
@@ -1272,6 +1456,7 @@ exports.dateBlockRangeBlocksCount = dateBlockRangeBlocksCount;
|
|
|
1272
1456
|
/**
|
|
1273
1457
|
* Creates a dateBlockRangesFullyCoverDateBlockRangeFunction
|
|
1274
1458
|
*
|
|
1459
|
+
* @deprecated use DateCell implementation instead.
|
|
1275
1460
|
* @param ranges
|
|
1276
1461
|
* @returns
|
|
1277
1462
|
*/
|
|
@@ -1286,6 +1471,7 @@ exports.dateBlockRangesFullyCoverDateBlockRangeFunction = dateBlockRangesFullyCo
|
|
|
1286
1471
|
/**
|
|
1287
1472
|
* Expands a DateBlockRange into an array of DateBlock values.
|
|
1288
1473
|
*
|
|
1474
|
+
* @deprecated use DateCell implementation instead.
|
|
1289
1475
|
* @param block
|
|
1290
1476
|
* @returns
|
|
1291
1477
|
*/
|
|
@@ -1298,6 +1484,7 @@ exports.expandDateBlockRange = expandDateBlockRange;
|
|
|
1298
1484
|
/**
|
|
1299
1485
|
* Returns true if the input DateBlockRange is longer than 1 block (I.E. has a "to" value greater than it's "i" value).
|
|
1300
1486
|
*
|
|
1487
|
+
* @deprecated use DateCell implementation instead.
|
|
1301
1488
|
* @param input
|
|
1302
1489
|
*/
|
|
1303
1490
|
function dateBlockRangeHasRange(input) {
|
|
@@ -1307,6 +1494,7 @@ exports.dateBlockRangeHasRange = dateBlockRangeHasRange;
|
|
|
1307
1494
|
/**
|
|
1308
1495
|
* Reads the to index if it exists, or returns the block's index itself.
|
|
1309
1496
|
*
|
|
1497
|
+
* @deprecated use DateCell implementation instead.
|
|
1310
1498
|
* @param input
|
|
1311
1499
|
* @returns
|
|
1312
1500
|
*/
|
|
@@ -1317,6 +1505,8 @@ function dateBlockEndIndex(input) {
|
|
|
1317
1505
|
exports.dateBlockEndIndex = dateBlockEndIndex;
|
|
1318
1506
|
/**
|
|
1319
1507
|
* Groups all input DateBlockRange or UniqueDateBlock values into a UniqueDateBlockRangeGroup value amd sorts the input.
|
|
1508
|
+
*
|
|
1509
|
+
* @deprecated use DateCell implementation instead.
|
|
1320
1510
|
*/
|
|
1321
1511
|
function groupUniqueDateBlocks(input) {
|
|
1322
1512
|
var _a;
|
|
@@ -1337,6 +1527,12 @@ function groupUniqueDateBlocks(input) {
|
|
|
1337
1527
|
};
|
|
1338
1528
|
}
|
|
1339
1529
|
exports.groupUniqueDateBlocks = groupUniqueDateBlocks;
|
|
1530
|
+
/**
|
|
1531
|
+
*
|
|
1532
|
+
* @deprecated use DateCell implementation instead.
|
|
1533
|
+
* @param config
|
|
1534
|
+
* @returns
|
|
1535
|
+
*/
|
|
1340
1536
|
function expandUniqueDateBlocksFunction(config) {
|
|
1341
1537
|
const { startAtIndex = 0, endAtIndex, fillOption: fill, fillFactory: inputFillFactory, retainOnOverlap: inputRetainOnOverlap } = config;
|
|
1342
1538
|
const retainOnOverlap = inputRetainOnOverlap !== null && inputRetainOnOverlap !== void 0 ? inputRetainOnOverlap : 'next';
|
|
@@ -1568,6 +1764,8 @@ function expandUniqueDateBlocksFunction(config) {
|
|
|
1568
1764
|
exports.expandUniqueDateBlocksFunction = expandUniqueDateBlocksFunction;
|
|
1569
1765
|
/**
|
|
1570
1766
|
* Creatse a ModifyDateBlocksToFitRangeFunction
|
|
1767
|
+
*
|
|
1768
|
+
* @deprecated use DateCell implementation instead.
|
|
1571
1769
|
*/
|
|
1572
1770
|
function modifyDateBlocksToFitRangeFunction(range) {
|
|
1573
1771
|
const { i, to } = dateBlockRangeWithRange(range);
|
|
@@ -1593,10 +1791,24 @@ function modifyDateBlocksToFitRangeFunction(range) {
|
|
|
1593
1791
|
}));
|
|
1594
1792
|
}
|
|
1595
1793
|
exports.modifyDateBlocksToFitRangeFunction = modifyDateBlocksToFitRangeFunction;
|
|
1794
|
+
/**
|
|
1795
|
+
*
|
|
1796
|
+
* @deprecated use DateCell implementation instead.
|
|
1797
|
+
* @param range
|
|
1798
|
+
* @param input
|
|
1799
|
+
* @returns
|
|
1800
|
+
*/
|
|
1596
1801
|
function modifyDateBlocksToFitRange(range, input) {
|
|
1597
1802
|
return modifyDateBlocksToFitRangeFunction(range)(input);
|
|
1598
1803
|
}
|
|
1599
1804
|
exports.modifyDateBlocksToFitRange = modifyDateBlocksToFitRange;
|
|
1805
|
+
/**
|
|
1806
|
+
*
|
|
1807
|
+
* @deprecated use DateCell implementation instead.
|
|
1808
|
+
* @param range
|
|
1809
|
+
* @param input
|
|
1810
|
+
* @returns
|
|
1811
|
+
*/
|
|
1600
1812
|
function modifyDateBlockToFitRange(range, input) {
|
|
1601
1813
|
return modifyDateBlocksToFitRange(range, [input])[0];
|
|
1602
1814
|
}
|