@dereekb/date 9.24.46 → 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.
Files changed (77) hide show
  1. package/CHANGELOG.md +13 -0
  2. package/package.json +2 -2
  3. package/src/lib/date/date.block.d.ts +373 -16
  4. package/src/lib/date/date.block.day.d.ts +1 -0
  5. package/src/lib/date/date.block.day.js +1 -0
  6. package/src/lib/date/date.block.day.js.map +1 -1
  7. package/src/lib/date/date.block.js +236 -24
  8. package/src/lib/date/date.block.js.map +1 -1
  9. package/src/lib/date/{date.validator.d.ts → date.block.validator.d.ts} +6 -0
  10. package/src/lib/date/{date.validator.js → date.block.validator.js} +7 -1
  11. package/src/lib/date/date.block.validator.js.map +1 -0
  12. package/src/lib/date/date.block.week.d.ts +24 -0
  13. package/src/lib/date/date.block.week.js +12 -0
  14. package/src/lib/date/date.block.week.js.map +1 -1
  15. package/src/lib/date/date.cell.d.ts +357 -0
  16. package/src/lib/date/date.cell.factory.d.ts +337 -0
  17. package/src/lib/date/date.cell.factory.js +479 -0
  18. package/src/lib/date/date.cell.factory.js.map +1 -0
  19. package/src/lib/date/date.cell.filter.d.ts +18 -0
  20. package/src/lib/date/date.cell.filter.js +65 -0
  21. package/src/lib/date/date.cell.filter.js.map +1 -0
  22. package/src/lib/date/date.cell.index.d.ts +375 -0
  23. package/src/lib/date/date.cell.index.js +731 -0
  24. package/src/lib/date/date.cell.index.js.map +1 -0
  25. package/src/lib/date/date.cell.js +518 -0
  26. package/src/lib/date/date.cell.js.map +1 -0
  27. package/src/lib/date/date.cell.schedule.d.ts +409 -0
  28. package/src/lib/date/date.cell.schedule.day.d.ts +9 -0
  29. package/src/lib/date/date.cell.schedule.day.js +15 -0
  30. package/src/lib/date/date.cell.schedule.day.js.map +1 -0
  31. package/src/lib/date/date.cell.schedule.js +667 -0
  32. package/src/lib/date/date.cell.schedule.js.map +1 -0
  33. package/src/lib/date/date.cell.validator.d.ts +14 -0
  34. package/src/lib/date/date.cell.validator.js +67 -0
  35. package/src/lib/date/date.cell.validator.js.map +1 -0
  36. package/src/lib/date/date.cell.week.d.ts +31 -0
  37. package/src/lib/date/date.cell.week.js +40 -0
  38. package/src/lib/date/date.cell.week.js.map +1 -0
  39. package/src/lib/date/date.d.ts +18 -0
  40. package/src/lib/date/date.duration.d.ts +2 -1
  41. package/src/lib/date/date.duration.js +6 -1
  42. package/src/lib/date/date.duration.js.map +1 -1
  43. package/src/lib/date/date.format.js +2 -1
  44. package/src/lib/date/date.format.js.map +1 -1
  45. package/src/lib/date/date.js +29 -1
  46. package/src/lib/date/date.js.map +1 -1
  47. package/src/lib/date/date.range.d.ts +4 -2
  48. package/src/lib/date/date.range.js +6 -4
  49. package/src/lib/date/date.range.js.map +1 -1
  50. package/src/lib/date/date.range.timezone.d.ts +27 -6
  51. package/src/lib/date/date.range.timezone.js +21 -7
  52. package/src/lib/date/date.range.timezone.js.map +1 -1
  53. package/src/lib/date/date.schedule.d.ts +99 -0
  54. package/src/lib/date/date.schedule.js +63 -0
  55. package/src/lib/date/date.schedule.js.map +1 -1
  56. package/src/lib/date/date.time.js +3 -3
  57. package/src/lib/date/date.time.js.map +1 -1
  58. package/src/lib/date/date.timezone.d.ts +98 -3
  59. package/src/lib/date/date.timezone.js +191 -24
  60. package/src/lib/date/date.timezone.js.map +1 -1
  61. package/src/lib/date/date.week.js +3 -1
  62. package/src/lib/date/date.week.js.map +1 -1
  63. package/src/lib/date/index.d.ts +8 -1
  64. package/src/lib/date/index.js +8 -1
  65. package/src/lib/date/index.js.map +1 -1
  66. package/src/lib/expires/expires.js +1 -1
  67. package/src/lib/expires/expires.js.map +1 -1
  68. package/src/lib/timezone/index.d.ts +1 -0
  69. package/src/lib/timezone/index.js +1 -0
  70. package/src/lib/timezone/index.js.map +1 -1
  71. package/src/lib/timezone/timezone.d.ts +7 -0
  72. package/src/lib/timezone/timezone.js +14 -2
  73. package/src/lib/timezone/timezone.js.map +1 -1
  74. package/src/lib/timezone/timezone.validator.d.ts +6 -0
  75. package/src/lib/timezone/timezone.validator.js +26 -0
  76. package/src/lib/timezone/timezone.validator.js.map +1 -0
  77. package/src/lib/date/date.validator.js.map +0 -1
@@ -0,0 +1,479 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.isDateWithinDateCellRangeFunction = exports.updateDateCellTimingWithDateCellTimingEvent = exports.dateCellTimingFromDateCellTimingStartsAtEndRange = exports.getRelativeDateForDateCellTiming = exports.dateCellTimingEndDateFactory = exports.dateCellTimingStartsAtDateFactory = exports.dateCellTimingStartDateFactory = exports.dateCellTimingDateFactory = exports.getRelativeIndexForDateCellTiming = exports.dateCellTimingRelativeIndexArrayFactory = exports.dateCellTimingRelativeIndexFactory = exports.isDateCellTimingRelativeIndexFactory = exports.dateCellDayTimingInfoFactory = exports.dateCellTimingExpansionFactory = exports.expandDateCellTiming = exports.expandDateCellCollection = exports.dateCellIndexRange = exports.dateCellIndexRangeToDateCellRange = exports.dateCellRangeToDateCellIndexRange = void 0;
4
+ const util_1 = require("@dereekb/util");
5
+ const date_fns_1 = require("date-fns");
6
+ const date_1 = require("./date");
7
+ const date_cell_1 = require("./date.cell");
8
+ const date_cell_index_1 = require("./date.cell.index");
9
+ const date_format_1 = require("./date.format");
10
+ const date_range_1 = require("./date.range");
11
+ const date_timezone_1 = require("./date.timezone");
12
+ function dateCellRangeToDateCellIndexRange(range) {
13
+ var _a;
14
+ return { minIndex: range.i, maxIndex: ((_a = range.to) !== null && _a !== void 0 ? _a : range.i) + 1 };
15
+ }
16
+ exports.dateCellRangeToDateCellIndexRange = dateCellRangeToDateCellIndexRange;
17
+ function dateCellIndexRangeToDateCellRange(range) {
18
+ return { i: range.minIndex, to: range.maxIndex - 1 };
19
+ }
20
+ exports.dateCellIndexRangeToDateCellRange = dateCellIndexRangeToDateCellRange;
21
+ /**
22
+ * Generates a DateCellIndexRange based on the input timing.
23
+ *
24
+ * An arbitrary limit can also be applied.
25
+ *
26
+ * @param timing
27
+ * @param limit
28
+ * @param fitToTimingRange
29
+ */
30
+ function dateCellIndexRange(timing, limit, fitToTimingRange = true) {
31
+ const indexFactory = dateCellTimingRelativeIndexFactory(timing);
32
+ const { startsAt: lastStartsAt } = (0, date_cell_1.dateCellTimingFinalStartsAtEvent)(timing); // use last startsAt date for the proper date
33
+ let minIndex = 0;
34
+ let maxIndex = indexFactory(lastStartsAt) + 1; // add one since this is a DateCellIndexRange, and not a DateCellRange.
35
+ if (limit) {
36
+ const { start, end } = (0, date_cell_1.dateCellTiming)(timing, limit);
37
+ const limitMin = indexFactory(start);
38
+ const limitMax = indexFactory(end) + 1;
39
+ if (fitToTimingRange) {
40
+ minIndex = Math.min(limitMin, maxIndex);
41
+ maxIndex = Math.min(limitMax, maxIndex);
42
+ }
43
+ else {
44
+ minIndex = limitMin;
45
+ maxIndex = limitMax;
46
+ }
47
+ }
48
+ return { minIndex, maxIndex };
49
+ }
50
+ exports.dateCellIndexRange = dateCellIndexRange;
51
+ /**
52
+ * Convenience function for calling expandDateCells() with the input DateCellCollection.
53
+ *
54
+ * @param collection
55
+ * @returns
56
+ */
57
+ function expandDateCellCollection(collection) {
58
+ return expandDateCellTiming(collection.timing, collection.blocks);
59
+ }
60
+ exports.expandDateCellCollection = expandDateCellCollection;
61
+ /**
62
+ * Convenience function for calling dateCellTimingExpansionFactory() then passing the blocks.
63
+ *
64
+ * @param blocks
65
+ * @param timing
66
+ * @returns
67
+ */
68
+ function expandDateCellTiming(timing, blocks) {
69
+ return dateCellTimingExpansionFactory({ timing })(blocks);
70
+ }
71
+ exports.expandDateCellTiming = expandDateCellTiming;
72
+ /**
73
+ * Creates a DateCellTimingExpansionFactory
74
+ *
75
+ * @param config
76
+ * @returns
77
+ */
78
+ function dateCellTimingExpansionFactory(config) {
79
+ const { timing, rangeLimit, filter: inputFilter, durationSpanFilter: inputDurationSpanFilter, maxDateCellsToReturn = Number.MAX_SAFE_INTEGER, blocksEvaluationLimit = Number.MAX_SAFE_INTEGER } = config;
80
+ const { duration } = timing;
81
+ const indexRange = rangeLimit !== false ? dateCellIndexRange(timing, rangeLimit) : { minIndex: Number.MIN_SAFE_INTEGER, maxIndex: Number.MAX_SAFE_INTEGER };
82
+ const isInRange = (0, util_1.indexRangeCheckFunction)({ indexRange, inclusiveMaxIndex: false });
83
+ const filter = (0, util_1.mergeFilterFunctions)((x) => isInRange(x.i), inputFilter);
84
+ const startsAtFactory = dateCellTimingStartsAtDateFactory(timing);
85
+ const durationSpanFilter = inputDurationSpanFilter !== null && inputDurationSpanFilter !== void 0 ? inputDurationSpanFilter : (() => true);
86
+ return (input) => {
87
+ const blocks = Array.isArray(input) ? input : input.blocks;
88
+ const spans = [];
89
+ let blocksEvaluated = 0;
90
+ function filterAndPush(block, blockIndex) {
91
+ // increase the evaluation count early in-case we set the blocksEvaluationLimit below.
92
+ blocksEvaluated += 1;
93
+ if (filter(block, blockIndex)) {
94
+ const startsAt = startsAtFactory(block.i);
95
+ const durationSpan = Object.assign(Object.assign({}, block), { startsAt,
96
+ duration });
97
+ // try the duration span filter
98
+ if (durationSpanFilter(durationSpan, blockIndex)) {
99
+ if (spans.length >= maxDateCellsToReturn) {
100
+ blocksEvaluated = blocksEvaluationLimit; // trigger return below
101
+ }
102
+ else {
103
+ spans.push(durationSpan);
104
+ }
105
+ }
106
+ }
107
+ }
108
+ blocks.findIndex((block) => {
109
+ if ((0, date_cell_index_1.dateCellRangeHasRange)(block)) {
110
+ // Expands the block's range as if it is at a single index
111
+ (0, util_1.range)(block.i, block.to + 1).findIndex((i) => {
112
+ const blockAtIndex = Object.assign(Object.assign({}, block), { i, to: i }); // copy block, set to as i
113
+ filterAndPush(blockAtIndex, blocksEvaluated);
114
+ // continue iterating until we hit the evaluation limit.
115
+ return blocksEvaluated >= blocksEvaluationLimit;
116
+ });
117
+ }
118
+ else {
119
+ filterAndPush(block, blocksEvaluated);
120
+ }
121
+ return blocksEvaluated >= blocksEvaluationLimit; // continue iterating until we hit the evaluation limit or run out of items.
122
+ });
123
+ return spans;
124
+ };
125
+ }
126
+ exports.dateCellTimingExpansionFactory = dateCellTimingExpansionFactory;
127
+ function dateCellDayTimingInfoFactory(config) {
128
+ const { timing, rangeLimit } = config;
129
+ const { duration } = timing;
130
+ const indexRange = rangeLimit !== false ? dateCellIndexRange(timing, rangeLimit) : { minIndex: Number.MIN_SAFE_INTEGER, maxIndex: Number.MAX_SAFE_INTEGER };
131
+ const checkIsInRange = (0, util_1.indexRangeCheckFunction)({ indexRange, inclusiveMaxIndex: false });
132
+ const dayIndexFactory = dateCellTimingRelativeIndexFactory(timing);
133
+ const dayFactory = dateCellTimingDateFactory(timing);
134
+ const startsAtFactory = dateCellTimingStartsAtDateFactory(dayIndexFactory);
135
+ return (input, inputNow) => {
136
+ const date = typeof input === 'number' ? dayFactory(input) : input;
137
+ const dayIndex = dayIndexFactory(input);
138
+ const isInRange = checkIsInRange(dayIndex);
139
+ const now = inputNow !== null && inputNow !== void 0 ? inputNow : date;
140
+ const startsAtOnDay = startsAtFactory(dayIndex); // convert back to the proper date
141
+ const endsAtOnDay = (0, date_fns_1.addMinutes)(startsAtOnDay, duration);
142
+ const potentiallyInProgress = !(0, date_fns_1.isAfter)(startsAtOnDay, now); // is potentially in progress if the now is equal-to or after the start time.
143
+ const isInProgress = potentiallyInProgress && !(0, date_fns_1.isAfter)(now, endsAtOnDay);
144
+ const hasOccuredToday = potentiallyInProgress && !isInProgress;
145
+ const currentIndex = isInProgress || hasOccuredToday ? dayIndex : dayIndex - 1; // If not in progress and hasn't occured today, current index is the previous index.
146
+ const nextIndex = currentIndex + 1;
147
+ const nextIndexInRange = checkIsInRange(nextIndex) ? nextIndex : undefined;
148
+ const isComplete = currentIndex >= 0 && !nextIndexInRange && (!isInRange || hasOccuredToday);
149
+ return {
150
+ now,
151
+ date,
152
+ dayIndex,
153
+ currentIndex,
154
+ nextIndex,
155
+ hasOccuredToday,
156
+ isInProgress,
157
+ isInRange,
158
+ startsAtOnDay,
159
+ endsAtOnDay,
160
+ nextIndexInRange,
161
+ isComplete
162
+ };
163
+ };
164
+ }
165
+ exports.dateCellDayTimingInfoFactory = dateCellDayTimingInfoFactory;
166
+ /**
167
+ * Returns true if the input is a DateCellTimingRelativeIndexFactory.
168
+ *
169
+ * @param input
170
+ * @returns
171
+ */
172
+ function isDateCellTimingRelativeIndexFactory(input) {
173
+ return typeof input === 'function' && input._timing != null && input._normalInstance != null;
174
+ }
175
+ exports.isDateCellTimingRelativeIndexFactory = isDateCellTimingRelativeIndexFactory;
176
+ /**
177
+ * Creates a DateCellTimingRelativeIndexFactory from the input.
178
+ *
179
+ * @param input
180
+ * @returns
181
+ */
182
+ function dateCellTimingRelativeIndexFactory(input) {
183
+ if (isDateCellTimingRelativeIndexFactory(input)) {
184
+ return input;
185
+ }
186
+ else {
187
+ const timing = input;
188
+ const { start, normalInstance } = (0, date_cell_1.dateCellTimingStartPair)(input);
189
+ const startInUtc = normalInstance.baseDateToTargetDate(start); // takes the target date and puts in into UTC normal
190
+ const factory = ((input) => {
191
+ const inputType = typeof input;
192
+ let diff;
193
+ if (inputType === 'number') {
194
+ return input;
195
+ }
196
+ else if (inputType === 'string') {
197
+ const startOfDayInUtc = (0, date_format_1.parseISO8601DayStringToUTCDate)(input); // parse as UTC
198
+ diff = (0, date_fns_1.differenceInHours)(startOfDayInUtc, startInUtc, { roundingMethod: 'floor' }); // compare the UTC times. Round down.
199
+ // console.log({ startOfDayInUtc, diff, startInUtc });
200
+ }
201
+ else {
202
+ const dateInUtc = normalInstance.baseDateToTargetDate(input); // convert to UTC normal
203
+ diff = (0, date_fns_1.differenceInHours)(dateInUtc, startInUtc, { roundingMethod: 'floor' }); // compare the difference in UTC times. Round down.
204
+ // console.log({ input, dateInUtc, diff, startInUtc, tz: normalInstance.configuredTimezoneString, systemTargetOffset: normalInstance.targetDateToSystemDateOffset(input as Date) / MS_IN_HOUR, targetBaseOffset: normalInstance.targetDateToBaseDateOffset(input as Date) / MS_IN_HOUR });
205
+ }
206
+ const daysOffset = Math.floor(diff / util_1.HOURS_IN_DAY); // total number of hours difference from the original UTC date
207
+ return daysOffset ? daysOffset : 0; // do not return -0
208
+ });
209
+ factory._timing = timing;
210
+ factory._normalInstance = normalInstance;
211
+ return factory;
212
+ }
213
+ }
214
+ exports.dateCellTimingRelativeIndexFactory = dateCellTimingRelativeIndexFactory;
215
+ /**
216
+ * Creates a DateCellTimingRelativeIndexArrayFactory from the input DateCellTimingRelativeIndexFactory.
217
+ *
218
+ * @param indexFactory
219
+ */
220
+ function dateCellTimingRelativeIndexArrayFactory(indexFactory) {
221
+ const factory = ((input) => {
222
+ const inputAsArray = (0, util_1.asArray)(input);
223
+ const result = [];
224
+ inputAsArray.forEach((value) => {
225
+ var _a;
226
+ let resultIndexes;
227
+ if (typeof value === 'object' && !(0, util_1.isDate)(value)) {
228
+ if ((0, date_range_1.isDateRange)(value)) {
229
+ resultIndexes = (0, util_1.range)(indexFactory(value.start), indexFactory(value.end) + 1);
230
+ }
231
+ else {
232
+ resultIndexes = (0, util_1.range)(value.i, ((_a = value.to) !== null && _a !== void 0 ? _a : value.i) + 1);
233
+ }
234
+ }
235
+ else {
236
+ resultIndexes = [indexFactory(value)];
237
+ }
238
+ (0, util_1.mergeArrayIntoArray)(result, resultIndexes);
239
+ });
240
+ return result;
241
+ });
242
+ factory._indexFactory = indexFactory;
243
+ return factory;
244
+ }
245
+ exports.dateCellTimingRelativeIndexArrayFactory = dateCellTimingRelativeIndexArrayFactory;
246
+ /**
247
+ * Gets the relative index of the input date compared to the input timing.
248
+ *
249
+ * @param timing
250
+ * @param date
251
+ */
252
+ function getRelativeIndexForDateCellTiming(timing, date = new Date()) {
253
+ return dateCellTimingRelativeIndexFactory(timing)(date);
254
+ }
255
+ exports.getRelativeIndexForDateCellTiming = getRelativeIndexForDateCellTiming;
256
+ /**
257
+ * Creates a DateCellTimingDateFactory.
258
+ *
259
+ * @param timing
260
+ * @returns
261
+ */
262
+ function dateCellTimingDateFactory(timing) {
263
+ const { start, normalInstance } = (0, date_cell_1.dateCellTimingStartPair)(timing);
264
+ const utcStartDate = normalInstance.baseDateToTargetDate(start);
265
+ const startUtcHours = start.getUTCHours();
266
+ const factory = ((input) => {
267
+ if ((0, util_1.isDate)(input)) {
268
+ return input;
269
+ }
270
+ else {
271
+ const now = new Date();
272
+ const nowHours = now.getUTCHours();
273
+ const utcStartDateWithNowTime = new Date(Date.UTC(utcStartDate.getUTCFullYear(), utcStartDate.getUTCMonth(), utcStartDate.getUTCDate(), nowHours, now.getUTCMinutes(), now.getUTCSeconds(), now.getUTCMilliseconds()));
274
+ // if the current hours are less than the UTC offset hours, then bump one extra day forward to be sure we're in the correct day.
275
+ if (startUtcHours > nowHours) {
276
+ input += 1;
277
+ }
278
+ const nowWithDateForIndex = (0, date_fns_1.addHours)(utcStartDateWithNowTime, input * util_1.HOURS_IN_DAY); // add days to apply the correct offset to the target index
279
+ return nowWithDateForIndex;
280
+ }
281
+ });
282
+ factory._timing = timing;
283
+ return factory;
284
+ }
285
+ exports.dateCellTimingDateFactory = dateCellTimingDateFactory;
286
+ /**
287
+ * Creates a DateCellTimingDateFactory.
288
+ *
289
+ * @param timing
290
+ * @returns
291
+ */
292
+ function dateCellTimingStartDateFactory(input) {
293
+ const indexFactory = dateCellTimingRelativeIndexFactory(input);
294
+ const { start, normalInstance } = (0, date_cell_1.dateCellTimingStartPair)(indexFactory._timing);
295
+ const utcStartDate = normalInstance.baseDateToTargetDate(start);
296
+ const factory = ((input) => {
297
+ const index = indexFactory(input); // get the index
298
+ const startInUtc = (0, date_fns_1.addHours)(utcStartDate, index * util_1.HOURS_IN_DAY);
299
+ return normalInstance.targetDateToBaseDate(startInUtc);
300
+ });
301
+ factory._indexFactory = indexFactory;
302
+ return factory;
303
+ }
304
+ exports.dateCellTimingStartDateFactory = dateCellTimingStartDateFactory;
305
+ function dateCellTimingStartsAtDateFactory(input) {
306
+ const indexFactory = dateCellTimingRelativeIndexFactory(input);
307
+ const normalInstance = indexFactory._normalInstance;
308
+ const utcStartsAtDate = normalInstance.baseDateToTargetDate(indexFactory._timing.startsAt);
309
+ const factory = ((input) => {
310
+ const index = indexFactory(input); // get the index
311
+ const startAtInUtc = (0, date_fns_1.addHours)(utcStartsAtDate, index * util_1.HOURS_IN_DAY);
312
+ return normalInstance.targetDateToBaseDate(startAtInUtc);
313
+ });
314
+ factory._indexFactory = indexFactory;
315
+ return factory;
316
+ }
317
+ exports.dateCellTimingStartsAtDateFactory = dateCellTimingStartsAtDateFactory;
318
+ function dateCellTimingEndDateFactory(input) {
319
+ const startsAtDateFactory = dateCellTimingStartsAtDateFactory(input);
320
+ const { duration } = startsAtDateFactory._indexFactory._timing;
321
+ const factory = ((input) => {
322
+ const startsAt = startsAtDateFactory(input); // get the startsAt for that day
323
+ return (0, date_fns_1.addMinutes)(startsAt, duration); // add the duration
324
+ });
325
+ factory._startsAtDateFactory = startsAtDateFactory;
326
+ return factory;
327
+ }
328
+ exports.dateCellTimingEndDateFactory = dateCellTimingEndDateFactory;
329
+ /**
330
+ * Returns the date of the input index.
331
+ *
332
+ * @param timing
333
+ * @param date
334
+ */
335
+ function getRelativeDateForDateCellTiming(timing, input) {
336
+ return dateCellTimingDateFactory(timing)(input);
337
+ }
338
+ exports.getRelativeDateForDateCellTiming = getRelativeDateForDateCellTiming;
339
+ /**
340
+ * Converts a DateCellTimingStartsAtEndRange to a DateCellTiming by calculating the difference in hours from the last startsAt timing and the end.
341
+ *
342
+ * @param dateCellTimingStartEndRange
343
+ * @param event
344
+ * @param timezone
345
+ * @returns
346
+ */
347
+ function dateCellTimingFromDateCellTimingStartsAtEndRange(dateCellTimingStartsAtEndRange) {
348
+ const { startsAt, timezone, end } = dateCellTimingStartsAtEndRange;
349
+ const duration = (0, date_cell_1.calculateExpectedDateCellTimingDuration)(dateCellTimingStartsAtEndRange);
350
+ const timing = {
351
+ timezone,
352
+ end,
353
+ startsAt,
354
+ duration
355
+ };
356
+ return timing;
357
+ }
358
+ exports.dateCellTimingFromDateCellTimingStartsAtEndRange = dateCellTimingFromDateCellTimingStartsAtEndRange;
359
+ /**
360
+ * Creates a new DateCellTiming from the input configuration.
361
+ *
362
+ * @param dateCellTimingStartEndRange
363
+ * @param event
364
+ * @param timezone
365
+ * @returns
366
+ */
367
+ function updateDateCellTimingWithDateCellTimingEvent(input) {
368
+ const { timing, event, replaceStartDay, replaceStartsAt, startDayDate: startDateDay, endOnEvent, replaceDuration } = input;
369
+ const { timezone } = timing;
370
+ const currentDuration = (0, date_cell_1.calculateExpectedDateCellTimingDuration)(timing);
371
+ let startsAt = timing.startsAt;
372
+ let end = timing.end;
373
+ let duration = currentDuration;
374
+ if (replaceStartDay || replaceStartsAt) {
375
+ // if replacing both startsAt and start day, then just set the new starts at time
376
+ if (replaceStartsAt && replaceStartDay) {
377
+ startsAt = event.startsAt; // use the new startsAt as-is
378
+ }
379
+ else if (replaceStartDay) {
380
+ // keep the same time, but use the day
381
+ let { start: eventStartDate, normalInstance } = (0, date_cell_1.dateCellTimingStartPair)({ startsAt: event.startsAt, timezone });
382
+ if (startDateDay != null) {
383
+ const startDateFactory = dateCellTimingStartDateFactory(timing);
384
+ eventStartDate = startDateFactory(startDateDay);
385
+ }
386
+ startsAt = (0, date_timezone_1.copyHoursAndMinutesFromDateWithTimezoneNormal)(eventStartDate, timing.startsAt, normalInstance);
387
+ }
388
+ else {
389
+ // if we're only replacing the startsAt, copy the hours/minutes from the target time
390
+ const { start: currentStart, normalInstance } = (0, date_cell_1.dateCellTimingStartPair)(timing);
391
+ startsAt = (0, date_timezone_1.copyHoursAndMinutesFromDateWithTimezoneNormal)(currentStart, event.startsAt, normalInstance);
392
+ }
393
+ }
394
+ if (endOnEvent != null || replaceDuration != null) {
395
+ const startsAtDateFactory = dateCellTimingStartsAtDateFactory({ startsAt, timezone });
396
+ let lastStartsAt;
397
+ // the end day should be the date provided by the event's startsAt date.
398
+ if (endOnEvent) {
399
+ lastStartsAt = startsAtDateFactory(event.startsAt);
400
+ }
401
+ else {
402
+ lastStartsAt = (0, date_cell_1.dateCellTimingFinalStartsAtEvent)(timing).startsAt;
403
+ }
404
+ if (replaceDuration) {
405
+ duration = event.duration;
406
+ }
407
+ end = (0, date_fns_1.addMinutes)(lastStartsAt, duration);
408
+ }
409
+ return {
410
+ timezone,
411
+ start: (0, date_cell_1.dateCellTimingStart)({ startsAt, timezone }),
412
+ startsAt,
413
+ end,
414
+ duration
415
+ };
416
+ }
417
+ exports.updateDateCellTimingWithDateCellTimingEvent = updateDateCellTimingWithDateCellTimingEvent;
418
+ function isDateWithinDateCellRangeFunction(config) {
419
+ const { startsAt: inputStartsAt, range: inputRange } = config;
420
+ let startsAt = inputStartsAt;
421
+ let dateRange;
422
+ let rangeInput;
423
+ let isDateInput = false;
424
+ if (typeof inputRange === 'number') {
425
+ rangeInput = { i: inputRange };
426
+ }
427
+ else if ((0, util_1.isDate)(inputRange)) {
428
+ dateRange = { start: inputRange };
429
+ isDateInput = true;
430
+ }
431
+ else if ((0, date_range_1.isDateRangeStart)(inputRange)) {
432
+ dateRange = inputRange;
433
+ }
434
+ else {
435
+ rangeInput = inputRange;
436
+ }
437
+ if (!inputStartsAt) {
438
+ if (dateRange && isDateInput) {
439
+ startsAt = { startsAt: inputRange, timezone: (0, date_1.guessCurrentTimezone)() };
440
+ }
441
+ }
442
+ if (!startsAt) {
443
+ throw new Error('Invalid isDateWithinDateCellRangeFunction() config. StartsAt date info could not be determined from input.');
444
+ }
445
+ const indexFactory = dateCellTimingRelativeIndexFactory(startsAt);
446
+ function convertDateRangeToIndexRange(range) {
447
+ const i = indexFactory(range.start);
448
+ const end = range.end;
449
+ const to = end != null ? indexFactory(end) : undefined;
450
+ return { i, to };
451
+ }
452
+ if (!rangeInput) {
453
+ if (dateRange) {
454
+ rangeInput = convertDateRangeToIndexRange(dateRange);
455
+ }
456
+ else {
457
+ throw new Error('Invalid isDateWithinDateCellRangeFunction() config. Range determined from input.'); // shouldn't occur
458
+ }
459
+ }
460
+ const isDateCellWithinDateCellRange = (0, date_cell_index_1.isDateCellWithinDateCellRangeFunction)(rangeInput);
461
+ return (input) => {
462
+ let range;
463
+ if ((0, util_1.isDate)(input)) {
464
+ range = indexFactory(input);
465
+ }
466
+ else if ((0, date_range_1.isDateRangeStart)(input)) {
467
+ range = convertDateRangeToIndexRange(input);
468
+ }
469
+ else {
470
+ range = input;
471
+ }
472
+ if (typeof input === 'number') {
473
+ range = { i: input };
474
+ }
475
+ return isDateCellWithinDateCellRange(range);
476
+ };
477
+ }
478
+ exports.isDateWithinDateCellRangeFunction = isDateWithinDateCellRangeFunction;
479
+ //# sourceMappingURL=date.cell.factory.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"date.cell.factory.js","sourceRoot":"","sources":["../../../../../../packages/date/src/lib/date/date.cell.factory.ts"],"names":[],"mappings":";;;AAAA,wCAAgP;AAChP,uCAA4E;AAC5E,iCAA8C;AAC9C,2CAA0a;AAC1a,uDAA+N;AAC/N,+CAA+D;AAC/D,6CAAwF;AACxF,mDAA8J;AAS9J,SAAgB,iCAAiC,CAAC,KAAoB;;IACpE,OAAO,EAAE,QAAQ,EAAE,KAAK,CAAC,CAAC,EAAE,QAAQ,EAAE,CAAC,MAAA,KAAK,CAAC,EAAE,mCAAI,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,EAAE,CAAC;AACpE,CAAC;AAFD,8EAEC;AAED,SAAgB,iCAAiC,CAAC,KAAyB;IACzE,OAAO,EAAE,CAAC,EAAE,KAAK,CAAC,QAAQ,EAAE,EAAE,EAAE,KAAK,CAAC,QAAQ,GAAG,CAAC,EAAE,CAAC;AACvD,CAAC;AAFD,8EAEC;AAED;;;;;;;;GAQG;AACH,SAAgB,kBAAkB,CAAC,MAAsB,EAAE,KAAgC,EAAE,gBAAgB,GAAG,IAAI;IAClH,MAAM,YAAY,GAAG,kCAAkC,CAAC,MAAM,CAAC,CAAC;IAChE,MAAM,EAAE,QAAQ,EAAE,YAAY,EAAE,GAAG,IAAA,4CAAgC,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OAAO,EAAE,CAAC,EAAE,EAAE,EAAE,CAAC;IACnB,CAAC;IAED,IAAI,CAAC,UAAU,EAAE;QACf,IAAI,SAAS,EAAE;YACb,UAAU,GAAG,4BAA4B,CAAC,SAAS,CAAC,CAAC;SACtD;aAAM;YACL,MAAM,IAAI,KAAK,CAAC,kFAAkF,CAAC,CAAC,CAAC,kBAAkB;SACxH;KACF;IAED,MAAM,6BAA6B,GAAG,IAAA,uDAAqC,EAAC,UAAU,CAAC,CAAC;IAExF,OAAO,CAAC,KAAqC,EAAE,EAAE;QAC/C,IAAI,KAA6C,CAAC;QAElD,IAAI,IAAA,aAAM,EAAC,KAAK,CAAC,EAAE;YACjB,KAAK,GAAG,YAAY,CAAC,KAAK,CAAC,CAAC;SAC7B;aAAM,IAAI,IAAA,6BAAgB,EAAC,KAAK,CAAC,EAAE;YAClC,KAAK,GAAG,4BAA4B,CAAC,KAAK,CAAC,CAAC;SAC7C;aAAM;YACL,KAAK,GAAG,KAAK,CAAC;SACf;QAED,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE;YAC7B,KAAK,GAAG,EAAE,CAAC,EAAE,KAAK,EAAE,CAAC;SACtB;QAED,OAAO,6BAA6B,CAAC,KAAK,CAAC,CAAC;IAC9C,CAAC,CAAC;AACJ,CAAC;AAjED,8EAiEC"}
@@ -0,0 +1,18 @@
1
+ import { FilterFunction, Maybe } from '@dereekb/util';
2
+ import { DateCell, DateCellDurationSpan } from './date.cell';
3
+ import { DateCellRange, UniqueDateCell } from './date.cell.index';
4
+ export declare type DateCellDurationSpanFilterFunction<B extends DateCell = DateCell> = FilterFunction<DateCellDurationSpan<B>>;
5
+ export declare function dateCellDurationSpanHasStartedFilterFunction<B extends DateCell = DateCell>(now?: Date): DateCellDurationSpanFilterFunction<B>;
6
+ export declare function dateCellDurationSpanHasNotStartedFilterFunction<B extends DateCell = DateCell>(now?: Date): DateCellDurationSpanFilterFunction<B>;
7
+ export declare function dateCellDurationSpanHasEndedFilterFunction<B extends DateCell = DateCell>(now?: Date): DateCellDurationSpanFilterFunction<B>;
8
+ export declare function dateCellDurationSpanHasNotEndedFilterFunction<B extends DateCell = DateCell>(now?: Date): DateCellDurationSpanFilterFunction<B>;
9
+ /**
10
+ * Modifies or filter out any blocks that are outside the range to fit within the configured range.
11
+ */
12
+ export declare type ModifyDateCellsToFitRangeFunction = <B extends DateCell | DateCellRange | UniqueDateCell>(input: B[]) => B[];
13
+ /**
14
+ * Creatse a ModifyDateCellsToFitRangeFunction
15
+ */
16
+ export declare function modifyDateCellsToFitRangeFunction(range: DateCellRange): ModifyDateCellsToFitRangeFunction;
17
+ export declare function modifyDateCellsToFitRange<B extends DateCell | DateCellRange | UniqueDateCell>(range: DateCellRange, input: B[]): B[];
18
+ export declare function modifyDateCellToFitRange<B extends DateCell | DateCellRange | UniqueDateCell>(range: DateCellRange, input: B): Maybe<B>;
@@ -0,0 +1,65 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.modifyDateCellToFitRange = exports.modifyDateCellsToFitRange = exports.modifyDateCellsToFitRangeFunction = exports.dateCellDurationSpanHasNotEndedFilterFunction = exports.dateCellDurationSpanHasEndedFilterFunction = exports.dateCellDurationSpanHasNotStartedFilterFunction = exports.dateCellDurationSpanHasStartedFilterFunction = void 0;
4
+ const util_1 = require("@dereekb/util");
5
+ const date_fns_1 = require("date-fns");
6
+ const date_cell_index_1 = require("./date.cell.index");
7
+ const date_duration_1 = require("./date.duration");
8
+ function dateCellDurationSpanHasStartedFilterFunction(now = new Date()) {
9
+ return (x) => !(0, date_fns_1.isAfter)(x.startsAt, now); // startsAt <= now
10
+ }
11
+ exports.dateCellDurationSpanHasStartedFilterFunction = dateCellDurationSpanHasStartedFilterFunction;
12
+ function dateCellDurationSpanHasNotStartedFilterFunction(now = new Date()) {
13
+ return (x) => (0, date_fns_1.isAfter)(x.startsAt, now); // startsAt > now
14
+ }
15
+ exports.dateCellDurationSpanHasNotStartedFilterFunction = dateCellDurationSpanHasNotStartedFilterFunction;
16
+ function dateCellDurationSpanHasEndedFilterFunction(now = new Date()) {
17
+ return (x) => {
18
+ const endsAt = (0, date_duration_1.dateDurationSpanEndDate)(x);
19
+ return !(0, date_fns_1.isAfter)(endsAt, now); // endsAt <= now
20
+ };
21
+ }
22
+ exports.dateCellDurationSpanHasEndedFilterFunction = dateCellDurationSpanHasEndedFilterFunction;
23
+ function dateCellDurationSpanHasNotEndedFilterFunction(now = new Date()) {
24
+ return (x) => {
25
+ const endsAt = (0, date_duration_1.dateDurationSpanEndDate)(x);
26
+ return (0, date_fns_1.isAfter)(endsAt, now); // endsAt > now
27
+ };
28
+ }
29
+ exports.dateCellDurationSpanHasNotEndedFilterFunction = dateCellDurationSpanHasNotEndedFilterFunction;
30
+ /**
31
+ * Creatse a ModifyDateCellsToFitRangeFunction
32
+ */
33
+ function modifyDateCellsToFitRangeFunction(range) {
34
+ const { i, to } = (0, date_cell_index_1.dateCellRangeWithRange)(range);
35
+ const dateCellIsWithinDateCellRange = (0, date_cell_index_1.isDateCellWithinDateCellRangeFunction)(range);
36
+ const overlapsRange = (0, date_cell_index_1.dateCellRangeOverlapsRangeFunction)(range);
37
+ return (input) => (0, util_1.filterMaybeValues)(input.map((x) => {
38
+ let result;
39
+ const inRange = dateCellIsWithinDateCellRange(x);
40
+ if (inRange) {
41
+ // if contained within the range then return as-is
42
+ result = x;
43
+ }
44
+ else {
45
+ // fit to the range otherwise
46
+ const asRange = (0, date_cell_index_1.dateCellRangeWithRange)(x);
47
+ const rangesOverlap = overlapsRange(asRange);
48
+ if (rangesOverlap) {
49
+ result = Object.assign(Object.assign({}, x), { i: Math.max(i, asRange.i), to: Math.min(to, asRange.to) // should be no larger than to
50
+ });
51
+ }
52
+ }
53
+ return result;
54
+ }));
55
+ }
56
+ exports.modifyDateCellsToFitRangeFunction = modifyDateCellsToFitRangeFunction;
57
+ function modifyDateCellsToFitRange(range, input) {
58
+ return modifyDateCellsToFitRangeFunction(range)(input);
59
+ }
60
+ exports.modifyDateCellsToFitRange = modifyDateCellsToFitRange;
61
+ function modifyDateCellToFitRange(range, input) {
62
+ return modifyDateCellsToFitRange(range, [input])[0];
63
+ }
64
+ exports.modifyDateCellToFitRange = modifyDateCellToFitRange;
65
+ //# sourceMappingURL=date.cell.filter.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"date.cell.filter.js","sourceRoot":"","sources":["../../../../../../packages/date/src/lib/date/date.cell.filter.ts"],"names":[],"mappings":";;;AAAA,wCAAyE;AACzE,uCAA6C;AAE7C,uDAAqK;AACrK,mDAA0D;AAI1D,SAAgB,4CAA4C,CAAgC,GAAG,GAAG,IAAI,IAAI,EAAE;IAC1G,OAAO,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,IAAA,kBAAO,EAAC,CAAC,CAAC,QAAQ,EAAE,GAAG,CAAC,CAAC,CAAC,kBAAkB;AAC7D,CAAC;AAFD,oGAEC;AAED,SAAgB,+CAA+C,CAAgC,GAAG,GAAG,IAAI,IAAI,EAAE;IAC7G,OAAO,CAAC,CAAC,EAAE,EAAE,CAAC,IAAA,kBAAO,EAAC,CAAC,CAAC,QAAQ,EAAE,GAAG,CAAC,CAAC,CAAC,iBAAiB;AAC3D,CAAC;AAFD,0GAEC;AAED,SAAgB,0CAA0C,CAAgC,GAAG,GAAG,IAAI,IAAI,EAAE;IACxG,OAAO,CAAC,CAAC,EAAE,EAAE;QACX,MAAM,MAAM,GAAG,IAAA,uCAAuB,EAAC,CAAC,CAAC,CAAC;QAC1C,OAAO,CAAC,IAAA,kBAAO,EAAC,MAAM,EAAE,GAAG,CAAC,CAAC,CAAC,gBAAgB;IAChD,CAAC,CAAC;AACJ,CAAC;AALD,gGAKC;AAED,SAAgB,6CAA6C,CAAgC,GAAG,GAAG,IAAI,IAAI,EAAE;IAC3G,OAAO,CAAC,CAAC,EAAE,EAAE;QACX,MAAM,MAAM,GAAG,IAAA,uCAAuB,EAAC,CAAC,CAAC,CAAC;QAC1C,OAAO,IAA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