@dereekb/date 13.3.0 → 13.4.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/index.cjs.js CHANGED
@@ -411,7 +411,7 @@ function isSameDateDay(a, b) {
411
411
  }
412
412
  function roundDateTo(date, roundToUnit) {
413
413
  var roundType = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : 'floor';
414
- return typeof date === 'number' ? roundDateToUnixDateTimeNumber(date, roundToUnit, roundType) : roundDateTo(date, roundToUnit, roundType);
414
+ return typeof date === 'number' ? roundDateToUnixDateTimeNumber(date, roundToUnit, roundType) : roundDateToDate(date, roundToUnit, roundType);
415
415
  }
416
416
  /**
417
417
  * Rounds a date or unix timestamp to the nearest unit boundary, always returning a Date.
@@ -966,14 +966,16 @@ function _is_native_reflect_construct$2() {
966
966
  * dateOrDateRangeToDateRange(existing); // returns the same range
967
967
  * ```
968
968
  */ function dateOrDateRangeToDateRange(startOrDateRange, end) {
969
+ var result;
969
970
  if (isDate(startOrDateRange)) {
970
- return {
971
+ result = {
971
972
  start: startOrDateRange,
972
973
  end: end !== null && end !== void 0 ? end : startOrDateRange
973
974
  };
974
975
  } else {
975
- return startOrDateRange;
976
+ result = startOrDateRange;
976
977
  }
978
+ return result;
977
979
  }
978
980
  exports.DateRangeType = void 0;
979
981
  (function(DateRangeType) {
@@ -1291,13 +1293,15 @@ var DEFAULT_EXPAND_DAYS_FOR_DATE_RANGE_MAX_EXPANSION_SIZE = 1500;
1291
1293
  * ```
1292
1294
  */ function dateRangeRelativeState(param) {
1293
1295
  var start = param.start, end = param.end, now = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : new Date();
1296
+ var result;
1294
1297
  if (dateFns.isAfter(now, end)) {
1295
- return 'past';
1298
+ result = 'past';
1296
1299
  } else if (dateFns.isBefore(now, start)) {
1297
- return 'future';
1300
+ result = 'future';
1298
1301
  } else {
1299
- return 'present';
1302
+ result = 'present';
1300
1303
  }
1304
+ return result;
1301
1305
  }
1302
1306
  /**
1303
1307
  * Groups an array of date ranges into past, present, and future buckets based on the current moment (or provided `now`).
@@ -3020,7 +3024,8 @@ function formatToDayRangeString(startOrDateRange, endOrFormat, inputFormat) {
3020
3024
  var date = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : new Date();
3021
3025
  return "".concat(date.getUTCFullYear(), "-").concat((date.getUTCMonth() + 1).toString().padStart(2, '0'), "-").concat(date.getUTCDate().toString().padStart(2, '0'));
3022
3026
  }
3023
- /** date-fns format string for `MM/dd/yyyy` (e.g., `"01/15/2024"`). */ var monthDaySlashDateStringFormat = 'MM/dd/yyyy';
3027
+ /** date-fns format string for `MM/dd/yyyy` (e.g., `"01/15/2024"`). */ var MONTH_DAY_SLASH_DATE_STRING_FORMAT = 'MM/dd/yyyy';
3028
+ /** @deprecated use MONTH_DAY_SLASH_DATE_STRING_FORMAT instead. */ var monthDaySlashDateStringFormat = MONTH_DAY_SLASH_DATE_STRING_FORMAT;
3024
3029
  /**
3025
3030
  * Formats a Date as a month/day/year slash-separated string (`MM/dd/yyyy`). Defaults to the current date.
3026
3031
  *
@@ -3035,12 +3040,13 @@ function formatToDayRangeString(startOrDateRange, endOrFormat, inputFormat) {
3035
3040
  * ```
3036
3041
  */ function formatToMonthDaySlashDate() {
3037
3042
  var date = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : new Date();
3038
- return dateFns.format(date, monthDaySlashDateStringFormat);
3043
+ return dateFns.format(date, MONTH_DAY_SLASH_DATE_STRING_FORMAT);
3039
3044
  }
3040
3045
  /**
3041
3046
  * @deprecated use formatToMonthDaySlashDate instead.
3042
3047
  */ var formatToShortDateString = formatToMonthDaySlashDate;
3043
- /** date-fns format string for `MM/dd` (e.g., `"01/15"`). */ var dateMonthDayStringFormat = 'MM/dd';
3048
+ /** date-fns format string for `MM/dd` (e.g., `"01/15"`). */ var DATE_MONTH_DAY_STRING_FORMAT = 'MM/dd';
3049
+ /** @deprecated use DATE_MONTH_DAY_STRING_FORMAT instead. */ var dateMonthDayStringFormat = DATE_MONTH_DAY_STRING_FORMAT;
3044
3050
  /**
3045
3051
  * Formats a Date as a month/day string (`MM/dd`) without the year. Defaults to the current date.
3046
3052
  *
@@ -3055,7 +3061,7 @@ function formatToDayRangeString(startOrDateRange, endOrFormat, inputFormat) {
3055
3061
  * ```
3056
3062
  */ function formatToMonthDayString() {
3057
3063
  var date = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : new Date();
3058
- return dateFns.format(date, dateMonthDayStringFormat);
3064
+ return dateFns.format(date, DATE_MONTH_DAY_STRING_FORMAT);
3059
3065
  }
3060
3066
  /**
3061
3067
  * Formats a Date as a human-friendly weekday and month/day string (e.g., `"Mon, Jan 15th"`).
@@ -3072,7 +3078,8 @@ function formatToDayRangeString(startOrDateRange, endOrFormat, inputFormat) {
3072
3078
  */ function formatToDateString(date) {
3073
3079
  return dateFns.format(date, 'EEE, MMM do');
3074
3080
  }
3075
- /** date-fns format string for 12-hour time with AM/PM (e.g., `"9:00 AM"`). */ var dateTimeStringFormat = 'h:mm a';
3081
+ /** date-fns format string for 12-hour time with AM/PM (e.g., `"9:00 AM"`). */ var DATE_TIME_STRING_FORMAT = 'h:mm a';
3082
+ /** @deprecated use DATE_TIME_STRING_FORMAT instead. */ var dateTimeStringFormat = DATE_TIME_STRING_FORMAT;
3076
3083
  /**
3077
3084
  * Formats a Date as a 12-hour time string with AM/PM (e.g., `"9:00 AM"`).
3078
3085
  *
@@ -3086,9 +3093,10 @@ function formatToDayRangeString(startOrDateRange, endOrFormat, inputFormat) {
3086
3093
  * // "2:30 PM"
3087
3094
  * ```
3088
3095
  */ function formatToTimeString(date) {
3089
- return dateFns.format(date, dateTimeStringFormat);
3096
+ return dateFns.format(date, DATE_TIME_STRING_FORMAT);
3090
3097
  }
3091
- /** Combined date-fns format string for `MM/dd/yyyy h:mm a` (e.g., `"01/15/2024 9:00 AM"`). */ var dateShortDateAndTimeStringFormat = "".concat(monthDaySlashDateStringFormat, " ").concat(dateTimeStringFormat);
3098
+ /** Combined date-fns format string for `MM/dd/yyyy h:mm a` (e.g., `"01/15/2024 9:00 AM"`). */ var DATE_SHORT_DATE_AND_TIME_STRING_FORMAT = "".concat(MONTH_DAY_SLASH_DATE_STRING_FORMAT, " ").concat(DATE_TIME_STRING_FORMAT);
3099
+ /** @deprecated use DATE_SHORT_DATE_AND_TIME_STRING_FORMAT instead. */ var dateShortDateAndTimeStringFormat = DATE_SHORT_DATE_AND_TIME_STRING_FORMAT;
3092
3100
  /**
3093
3101
  * Formats a Date as a short date and time string (e.g., `"01/15/2024 9:00 AM"`).
3094
3102
  *
@@ -3102,7 +3110,7 @@ function formatToDayRangeString(startOrDateRange, endOrFormat, inputFormat) {
3102
3110
  * // "01/15/2024 2:30 PM"
3103
3111
  * ```
3104
3112
  */ function formatToShortDateAndTimeString(date) {
3105
- return dateFns.format(date, dateShortDateAndTimeStringFormat);
3113
+ return dateFns.format(date, DATE_SHORT_DATE_AND_TIME_STRING_FORMAT);
3106
3114
  }
3107
3115
  /**
3108
3116
  * Formats a start time with an appended duration indicator. For durations over 2 hours, uses
@@ -3552,11 +3560,12 @@ function _type_of$5(obj) {
3552
3560
  * @param input - value to check
3553
3561
  * @returns whether the input matches the DateCellTiming shape
3554
3562
  */ function isDateCellTiming(input) {
3563
+ var result = false;
3555
3564
  if ((typeof input === "undefined" ? "undefined" : _type_of$5(input)) === 'object') {
3556
3565
  var asTiming = input;
3557
- return isDate(asTiming.startsAt) && isDate(asTiming.end) && typeof asTiming.timezone === 'string' && typeof asTiming.duration === 'number';
3566
+ result = isDate(asTiming.startsAt) && isDate(asTiming.end) && typeof asTiming.timezone === 'string' && typeof asTiming.duration === 'number';
3558
3567
  }
3559
- return false;
3568
+ return result;
3560
3569
  }
3561
3570
  /**
3562
3571
  * Type guard that checks whether the input has the shape of a {@link FullDateCellTiming} (includes `start` field plus all DateCellTiming fields).
@@ -3566,11 +3575,12 @@ function _type_of$5(obj) {
3566
3575
  * @param input - value to check
3567
3576
  * @returns whether the input matches the FullDateCellTiming shape
3568
3577
  */ function isFullDateCellTiming(input) {
3578
+ var result = false;
3569
3579
  if ((typeof input === "undefined" ? "undefined" : _type_of$5(input)) === 'object') {
3570
3580
  var asTiming = input;
3571
- return isDate(asTiming.start) && isDateCellTiming(asTiming);
3581
+ result = isDate(asTiming.start) && isDateCellTiming(asTiming);
3572
3582
  }
3573
- return false;
3583
+ return result;
3574
3584
  }
3575
3585
  /**
3576
3586
  * Derives a {@link DateCellTimingDateRange} from a timing, using midnight in the timing's timezone as the start and the event's end time as the end.
@@ -5901,15 +5911,15 @@ function _unsupported_iterable_to_array$4(o, minLen) {
5901
5911
  * yearWeekCodeFromDate(new Date('2024-04-15')); // 202416
5902
5912
  * ```
5903
5913
  */ function yearWeekCodeFromDate(date, timezone) {
5914
+ var result;
5904
5915
  if (timezone) {
5905
- // use specified timezone
5906
- return yearWeekCodeFactory({
5916
+ result = yearWeekCodeFactory({
5907
5917
  timezone: timezone
5908
5918
  })(date);
5909
5919
  } else {
5910
- // Use system timezone
5911
- return yearWeekCodeFromPair(yearWeekCodePairFromDate(date));
5920
+ result = yearWeekCodeFromPair(yearWeekCodePairFromDate(date));
5912
5921
  }
5922
+ return result;
5913
5923
  }
5914
5924
  /**
5915
5925
  * Resolves a timezone input into a {@link DateTimezoneUtcNormalInstance} for use with YearWeekCode calculations.
@@ -8755,20 +8765,20 @@ function _object_spread_props$2(target, source) {
8755
8765
  */ key: "parseTimeString",
8756
8766
  value: function parseTimeString(input, config) {
8757
8767
  var timestringResult = this._timeStringToDate(input, config);
8768
+ var result;
8758
8769
  if (isValidDateFromTimestringResult(timestringResult)) {
8759
- var result = timestringResult.result, raw = timestringResult.raw;
8770
+ var dateResult = timestringResult.result, raw = timestringResult.raw;
8760
8771
  // Use minutes since start of day. Since differenceInMinutes uses system time, we convert the raw to system time first.
8761
8772
  var inSystemTime = systemNormalDateToBaseDate(raw);
8762
8773
  var minutesSinceStartOfDay = dateFns.differenceInMinutes(inSystemTime, dateFns.startOfDay(inSystemTime));
8763
- return {
8774
+ result = {
8764
8775
  utc: raw,
8765
- date: result,
8776
+ date: dateResult,
8766
8777
  minutesSinceStartOfDay: minutesSinceStartOfDay,
8767
8778
  am: minutesSinceStartOfDay < 720 ? util.TimeAM.AM : util.TimeAM.PM
8768
8779
  };
8769
- } else {
8770
- return undefined;
8771
8780
  }
8781
+ return result;
8772
8782
  }
8773
8783
  },
8774
8784
  {
@@ -8791,11 +8801,7 @@ function _object_spread_props$2(target, source) {
8791
8801
  */ key: "timeStringToDate",
8792
8802
  value: function timeStringToDate(input, config) {
8793
8803
  var _this__timeStringToDate = this._timeStringToDate(input, config), result = _this__timeStringToDate.result, valid = _this__timeStringToDate.valid;
8794
- if (valid) {
8795
- return result;
8796
- } else {
8797
- return undefined;
8798
- }
8804
+ return valid ? result : undefined;
8799
8805
  }
8800
8806
  },
8801
8807
  {
@@ -9553,13 +9559,15 @@ function _is_native_reflect_construct() {
9553
9559
  value: function accept(date) {
9554
9560
  ++this.total;
9555
9561
  var tooLate = date > this.maxDate;
9562
+ var result;
9556
9563
  if (tooLate) {
9557
- return false;
9564
+ result = false;
9558
9565
  } else {
9559
9566
  this.add(date);
9560
9567
  var maxIterationReached = this.total >= this._maxIterationsAllowed;
9561
- return !maxIterationReached;
9568
+ result = !maxIterationReached;
9562
9569
  }
9570
+ return result;
9563
9571
  }
9564
9572
  },
9565
9573
  {
@@ -9599,13 +9607,15 @@ function _is_native_reflect_construct() {
9599
9607
  value: function accept(date) {
9600
9608
  this.total += 1;
9601
9609
  var tooEarly = this.minDate > date;
9610
+ var result;
9602
9611
  if (tooEarly) {
9603
9612
  var maxIterationReached = this.total >= this.maxIterationsAllowed;
9604
- return !maxIterationReached;
9613
+ result = !maxIterationReached;
9605
9614
  } else {
9606
9615
  this.add(date);
9607
- return false;
9616
+ result = false;
9608
9617
  }
9618
+ return result;
9609
9619
  }
9610
9620
  },
9611
9621
  {
@@ -9648,18 +9658,20 @@ function _is_native_reflect_construct() {
9648
9658
  value: function accept(date) {
9649
9659
  ++this.total;
9650
9660
  var tooEarly = this.minDate != null && this.minDate > date;
9661
+ var result;
9651
9662
  if (tooEarly) {
9652
9663
  var maxIterationReached = this.total >= this.maxIterationsAllowed;
9653
- return !maxIterationReached;
9664
+ result = !maxIterationReached;
9654
9665
  } else {
9655
9666
  var tooLate = this.maxDate != null && this.maxDate < date;
9656
9667
  if (tooLate) {
9657
- return true;
9668
+ result = true;
9658
9669
  } else {
9659
9670
  this.add(date);
9660
- return false;
9671
+ result = false;
9661
9672
  }
9662
9673
  }
9674
+ return result;
9663
9675
  }
9664
9676
  },
9665
9677
  {
@@ -9749,7 +9761,8 @@ function _unsupported_iterable_to_array$1(o, minLen) {
9749
9761
  }
9750
9762
  /**
9751
9763
  * Delimiter separating the property name/params from values in an RRule line.
9752
- */ var RRuleStringSplitter = ':';
9764
+ */ var RRULE_STRING_SPLITTER = ':';
9765
+ /** @deprecated use RRULE_STRING_SPLITTER instead. */ var RRuleStringSplitter = RRULE_STRING_SPLITTER;
9753
9766
  /**
9754
9767
  * Utility class for parsing and manipulating RFC 5545 RRule strings.
9755
9768
  *
@@ -9947,18 +9960,20 @@ function _unsupported_iterable_to_array$1(o, minLen) {
9947
9960
  * Splits a raw line at the colon delimiter into params and values portions.
9948
9961
  * Falls back to treating a single-segment line as an RRULE value.
9949
9962
  */ function parseRawLine(line) {
9950
- var _splitJoinRemainder = _sliced_to_array$1(util.splitJoinRemainder(line, RRuleStringSplitter, 2), 2), params = _splitJoinRemainder[0], values = _splitJoinRemainder[1];
9963
+ var _splitJoinRemainder = _sliced_to_array$1(util.splitJoinRemainder(line, RRULE_STRING_SPLITTER, 2), 2), params = _splitJoinRemainder[0], values = _splitJoinRemainder[1];
9964
+ var result;
9951
9965
  if (line.length === 1) {
9952
- return {
9966
+ result = {
9953
9967
  params: 'RRULE',
9954
9968
  values: params
9955
9969
  };
9956
9970
  } else {
9957
- return {
9971
+ result = {
9958
9972
  params: params,
9959
9973
  values: values
9960
9974
  };
9961
9975
  }
9976
+ return result;
9962
9977
  }
9963
9978
  },
9964
9979
  {
@@ -10555,6 +10570,9 @@ Object.defineProperty(exports, "unixDateTimeSecondsNumberToDate", {
10555
10570
  });
10556
10571
  exports.AnyIterResult = AnyIterResult;
10557
10572
  exports.DATE_CELL_SCHEDULE_ENCODED_WEEK_REGEX = DATE_CELL_SCHEDULE_ENCODED_WEEK_REGEX;
10573
+ exports.DATE_MONTH_DAY_STRING_FORMAT = DATE_MONTH_DAY_STRING_FORMAT;
10574
+ exports.DATE_SHORT_DATE_AND_TIME_STRING_FORMAT = DATE_SHORT_DATE_AND_TIME_STRING_FORMAT;
10575
+ exports.DATE_TIME_STRING_FORMAT = DATE_TIME_STRING_FORMAT;
10558
10576
  exports.DATE_TODAY_END_VALUE = DATE_TODAY_END_VALUE;
10559
10577
  exports.DATE_TODAY_START_VALUE = DATE_TODAY_START_VALUE;
10560
10578
  exports.DATE_WEEK_END_VALUE = DATE_WEEK_END_VALUE;
@@ -10575,8 +10593,10 @@ exports.IterateDaysInDateRangeFunctionBailError = IterateDaysInDateRangeFunction
10575
10593
  exports.LastIterResult = LastIterResult;
10576
10594
  exports.LimitDateTimeInstance = LimitDateTimeInstance;
10577
10595
  exports.MAX_FUTURE_DATE = MAX_FUTURE_DATE;
10596
+ exports.MONTH_DAY_SLASH_DATE_STRING_FORMAT = MONTH_DAY_SLASH_DATE_STRING_FORMAT;
10578
10597
  exports.ModelRecurrenceInfoUtility = ModelRecurrenceInfoUtility;
10579
10598
  exports.NextIterResult = NextIterResult;
10599
+ exports.RRULE_STRING_SPLITTER = RRULE_STRING_SPLITTER;
10580
10600
  exports.RRuleStringSplitter = RRuleStringSplitter;
10581
10601
  exports.SYSTEM_DATE_TIMEZONE_UTC_NORMAL_INSTANCE = SYSTEM_DATE_TIMEZONE_UTC_NORMAL_INSTANCE;
10582
10602
  exports.UNKNOWN_YEAR_WEEK_CODE = UNKNOWN_YEAR_WEEK_CODE;
package/index.esm.js CHANGED
@@ -410,7 +410,7 @@ function isSameDateDay(a, b) {
410
410
  }
411
411
  function roundDateTo(date, roundToUnit) {
412
412
  var roundType = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : 'floor';
413
- return typeof date === 'number' ? roundDateToUnixDateTimeNumber(date, roundToUnit, roundType) : roundDateTo(date, roundToUnit, roundType);
413
+ return typeof date === 'number' ? roundDateToUnixDateTimeNumber(date, roundToUnit, roundType) : roundDateToDate(date, roundToUnit, roundType);
414
414
  }
415
415
  /**
416
416
  * Rounds a date or unix timestamp to the nearest unit boundary, always returning a Date.
@@ -965,14 +965,16 @@ function _is_native_reflect_construct$2() {
965
965
  * dateOrDateRangeToDateRange(existing); // returns the same range
966
966
  * ```
967
967
  */ function dateOrDateRangeToDateRange(startOrDateRange, end) {
968
+ var result;
968
969
  if (isDate(startOrDateRange)) {
969
- return {
970
+ result = {
970
971
  start: startOrDateRange,
971
972
  end: end !== null && end !== void 0 ? end : startOrDateRange
972
973
  };
973
974
  } else {
974
- return startOrDateRange;
975
+ result = startOrDateRange;
975
976
  }
977
+ return result;
976
978
  }
977
979
  var DateRangeType;
978
980
  (function(DateRangeType) {
@@ -1290,13 +1292,15 @@ var DEFAULT_EXPAND_DAYS_FOR_DATE_RANGE_MAX_EXPANSION_SIZE = 1500;
1290
1292
  * ```
1291
1293
  */ function dateRangeRelativeState(param) {
1292
1294
  var start = param.start, end = param.end, now = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : new Date();
1295
+ var result;
1293
1296
  if (isAfter$1(now, end)) {
1294
- return 'past';
1297
+ result = 'past';
1295
1298
  } else if (isBefore$1(now, start)) {
1296
- return 'future';
1299
+ result = 'future';
1297
1300
  } else {
1298
- return 'present';
1301
+ result = 'present';
1299
1302
  }
1303
+ return result;
1300
1304
  }
1301
1305
  /**
1302
1306
  * Groups an array of date ranges into past, present, and future buckets based on the current moment (or provided `now`).
@@ -3019,7 +3023,8 @@ function formatToDayRangeString(startOrDateRange, endOrFormat, inputFormat) {
3019
3023
  var date = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : new Date();
3020
3024
  return "".concat(date.getUTCFullYear(), "-").concat((date.getUTCMonth() + 1).toString().padStart(2, '0'), "-").concat(date.getUTCDate().toString().padStart(2, '0'));
3021
3025
  }
3022
- /** date-fns format string for `MM/dd/yyyy` (e.g., `"01/15/2024"`). */ var monthDaySlashDateStringFormat = 'MM/dd/yyyy';
3026
+ /** date-fns format string for `MM/dd/yyyy` (e.g., `"01/15/2024"`). */ var MONTH_DAY_SLASH_DATE_STRING_FORMAT = 'MM/dd/yyyy';
3027
+ /** @deprecated use MONTH_DAY_SLASH_DATE_STRING_FORMAT instead. */ var monthDaySlashDateStringFormat = MONTH_DAY_SLASH_DATE_STRING_FORMAT;
3023
3028
  /**
3024
3029
  * Formats a Date as a month/day/year slash-separated string (`MM/dd/yyyy`). Defaults to the current date.
3025
3030
  *
@@ -3034,12 +3039,13 @@ function formatToDayRangeString(startOrDateRange, endOrFormat, inputFormat) {
3034
3039
  * ```
3035
3040
  */ function formatToMonthDaySlashDate() {
3036
3041
  var date = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : new Date();
3037
- return format$1(date, monthDaySlashDateStringFormat);
3042
+ return format$1(date, MONTH_DAY_SLASH_DATE_STRING_FORMAT);
3038
3043
  }
3039
3044
  /**
3040
3045
  * @deprecated use formatToMonthDaySlashDate instead.
3041
3046
  */ var formatToShortDateString = formatToMonthDaySlashDate;
3042
- /** date-fns format string for `MM/dd` (e.g., `"01/15"`). */ var dateMonthDayStringFormat = 'MM/dd';
3047
+ /** date-fns format string for `MM/dd` (e.g., `"01/15"`). */ var DATE_MONTH_DAY_STRING_FORMAT = 'MM/dd';
3048
+ /** @deprecated use DATE_MONTH_DAY_STRING_FORMAT instead. */ var dateMonthDayStringFormat = DATE_MONTH_DAY_STRING_FORMAT;
3043
3049
  /**
3044
3050
  * Formats a Date as a month/day string (`MM/dd`) without the year. Defaults to the current date.
3045
3051
  *
@@ -3054,7 +3060,7 @@ function formatToDayRangeString(startOrDateRange, endOrFormat, inputFormat) {
3054
3060
  * ```
3055
3061
  */ function formatToMonthDayString() {
3056
3062
  var date = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : new Date();
3057
- return format$1(date, dateMonthDayStringFormat);
3063
+ return format$1(date, DATE_MONTH_DAY_STRING_FORMAT);
3058
3064
  }
3059
3065
  /**
3060
3066
  * Formats a Date as a human-friendly weekday and month/day string (e.g., `"Mon, Jan 15th"`).
@@ -3071,7 +3077,8 @@ function formatToDayRangeString(startOrDateRange, endOrFormat, inputFormat) {
3071
3077
  */ function formatToDateString(date) {
3072
3078
  return format$1(date, 'EEE, MMM do');
3073
3079
  }
3074
- /** date-fns format string for 12-hour time with AM/PM (e.g., `"9:00 AM"`). */ var dateTimeStringFormat = 'h:mm a';
3080
+ /** date-fns format string for 12-hour time with AM/PM (e.g., `"9:00 AM"`). */ var DATE_TIME_STRING_FORMAT = 'h:mm a';
3081
+ /** @deprecated use DATE_TIME_STRING_FORMAT instead. */ var dateTimeStringFormat = DATE_TIME_STRING_FORMAT;
3075
3082
  /**
3076
3083
  * Formats a Date as a 12-hour time string with AM/PM (e.g., `"9:00 AM"`).
3077
3084
  *
@@ -3085,9 +3092,10 @@ function formatToDayRangeString(startOrDateRange, endOrFormat, inputFormat) {
3085
3092
  * // "2:30 PM"
3086
3093
  * ```
3087
3094
  */ function formatToTimeString(date) {
3088
- return format$1(date, dateTimeStringFormat);
3095
+ return format$1(date, DATE_TIME_STRING_FORMAT);
3089
3096
  }
3090
- /** Combined date-fns format string for `MM/dd/yyyy h:mm a` (e.g., `"01/15/2024 9:00 AM"`). */ var dateShortDateAndTimeStringFormat = "".concat(monthDaySlashDateStringFormat, " ").concat(dateTimeStringFormat);
3097
+ /** Combined date-fns format string for `MM/dd/yyyy h:mm a` (e.g., `"01/15/2024 9:00 AM"`). */ var DATE_SHORT_DATE_AND_TIME_STRING_FORMAT = "".concat(MONTH_DAY_SLASH_DATE_STRING_FORMAT, " ").concat(DATE_TIME_STRING_FORMAT);
3098
+ /** @deprecated use DATE_SHORT_DATE_AND_TIME_STRING_FORMAT instead. */ var dateShortDateAndTimeStringFormat = DATE_SHORT_DATE_AND_TIME_STRING_FORMAT;
3091
3099
  /**
3092
3100
  * Formats a Date as a short date and time string (e.g., `"01/15/2024 9:00 AM"`).
3093
3101
  *
@@ -3101,7 +3109,7 @@ function formatToDayRangeString(startOrDateRange, endOrFormat, inputFormat) {
3101
3109
  * // "01/15/2024 2:30 PM"
3102
3110
  * ```
3103
3111
  */ function formatToShortDateAndTimeString(date) {
3104
- return format$1(date, dateShortDateAndTimeStringFormat);
3112
+ return format$1(date, DATE_SHORT_DATE_AND_TIME_STRING_FORMAT);
3105
3113
  }
3106
3114
  /**
3107
3115
  * Formats a start time with an appended duration indicator. For durations over 2 hours, uses
@@ -3551,11 +3559,12 @@ function _type_of$5(obj) {
3551
3559
  * @param input - value to check
3552
3560
  * @returns whether the input matches the DateCellTiming shape
3553
3561
  */ function isDateCellTiming(input) {
3562
+ var result = false;
3554
3563
  if ((typeof input === "undefined" ? "undefined" : _type_of$5(input)) === 'object') {
3555
3564
  var asTiming = input;
3556
- return isDate(asTiming.startsAt) && isDate(asTiming.end) && typeof asTiming.timezone === 'string' && typeof asTiming.duration === 'number';
3565
+ result = isDate(asTiming.startsAt) && isDate(asTiming.end) && typeof asTiming.timezone === 'string' && typeof asTiming.duration === 'number';
3557
3566
  }
3558
- return false;
3567
+ return result;
3559
3568
  }
3560
3569
  /**
3561
3570
  * Type guard that checks whether the input has the shape of a {@link FullDateCellTiming} (includes `start` field plus all DateCellTiming fields).
@@ -3565,11 +3574,12 @@ function _type_of$5(obj) {
3565
3574
  * @param input - value to check
3566
3575
  * @returns whether the input matches the FullDateCellTiming shape
3567
3576
  */ function isFullDateCellTiming(input) {
3577
+ var result = false;
3568
3578
  if ((typeof input === "undefined" ? "undefined" : _type_of$5(input)) === 'object') {
3569
3579
  var asTiming = input;
3570
- return isDate(asTiming.start) && isDateCellTiming(asTiming);
3580
+ result = isDate(asTiming.start) && isDateCellTiming(asTiming);
3571
3581
  }
3572
- return false;
3582
+ return result;
3573
3583
  }
3574
3584
  /**
3575
3585
  * Derives a {@link DateCellTimingDateRange} from a timing, using midnight in the timing's timezone as the start and the event's end time as the end.
@@ -5900,15 +5910,15 @@ function _unsupported_iterable_to_array$4(o, minLen) {
5900
5910
  * yearWeekCodeFromDate(new Date('2024-04-15')); // 202416
5901
5911
  * ```
5902
5912
  */ function yearWeekCodeFromDate(date, timezone) {
5913
+ var result;
5903
5914
  if (timezone) {
5904
- // use specified timezone
5905
- return yearWeekCodeFactory({
5915
+ result = yearWeekCodeFactory({
5906
5916
  timezone: timezone
5907
5917
  })(date);
5908
5918
  } else {
5909
- // Use system timezone
5910
- return yearWeekCodeFromPair(yearWeekCodePairFromDate(date));
5919
+ result = yearWeekCodeFromPair(yearWeekCodePairFromDate(date));
5911
5920
  }
5921
+ return result;
5912
5922
  }
5913
5923
  /**
5914
5924
  * Resolves a timezone input into a {@link DateTimezoneUtcNormalInstance} for use with YearWeekCode calculations.
@@ -8754,20 +8764,20 @@ function _object_spread_props$2(target, source) {
8754
8764
  */ key: "parseTimeString",
8755
8765
  value: function parseTimeString(input, config) {
8756
8766
  var timestringResult = this._timeStringToDate(input, config);
8767
+ var result;
8757
8768
  if (isValidDateFromTimestringResult(timestringResult)) {
8758
- var result = timestringResult.result, raw = timestringResult.raw;
8769
+ var dateResult = timestringResult.result, raw = timestringResult.raw;
8759
8770
  // Use minutes since start of day. Since differenceInMinutes uses system time, we convert the raw to system time first.
8760
8771
  var inSystemTime = systemNormalDateToBaseDate(raw);
8761
8772
  var minutesSinceStartOfDay = differenceInMinutes(inSystemTime, startOfDay(inSystemTime));
8762
- return {
8773
+ result = {
8763
8774
  utc: raw,
8764
- date: result,
8775
+ date: dateResult,
8765
8776
  minutesSinceStartOfDay: minutesSinceStartOfDay,
8766
8777
  am: minutesSinceStartOfDay < 720 ? TimeAM.AM : TimeAM.PM
8767
8778
  };
8768
- } else {
8769
- return undefined;
8770
8779
  }
8780
+ return result;
8771
8781
  }
8772
8782
  },
8773
8783
  {
@@ -8790,11 +8800,7 @@ function _object_spread_props$2(target, source) {
8790
8800
  */ key: "timeStringToDate",
8791
8801
  value: function timeStringToDate(input, config) {
8792
8802
  var _this__timeStringToDate = this._timeStringToDate(input, config), result = _this__timeStringToDate.result, valid = _this__timeStringToDate.valid;
8793
- if (valid) {
8794
- return result;
8795
- } else {
8796
- return undefined;
8797
- }
8803
+ return valid ? result : undefined;
8798
8804
  }
8799
8805
  },
8800
8806
  {
@@ -9552,13 +9558,15 @@ function _is_native_reflect_construct() {
9552
9558
  value: function accept(date) {
9553
9559
  ++this.total;
9554
9560
  var tooLate = date > this.maxDate;
9561
+ var result;
9555
9562
  if (tooLate) {
9556
- return false;
9563
+ result = false;
9557
9564
  } else {
9558
9565
  this.add(date);
9559
9566
  var maxIterationReached = this.total >= this._maxIterationsAllowed;
9560
- return !maxIterationReached;
9567
+ result = !maxIterationReached;
9561
9568
  }
9569
+ return result;
9562
9570
  }
9563
9571
  },
9564
9572
  {
@@ -9598,13 +9606,15 @@ function _is_native_reflect_construct() {
9598
9606
  value: function accept(date) {
9599
9607
  this.total += 1;
9600
9608
  var tooEarly = this.minDate > date;
9609
+ var result;
9601
9610
  if (tooEarly) {
9602
9611
  var maxIterationReached = this.total >= this.maxIterationsAllowed;
9603
- return !maxIterationReached;
9612
+ result = !maxIterationReached;
9604
9613
  } else {
9605
9614
  this.add(date);
9606
- return false;
9615
+ result = false;
9607
9616
  }
9617
+ return result;
9608
9618
  }
9609
9619
  },
9610
9620
  {
@@ -9647,18 +9657,20 @@ function _is_native_reflect_construct() {
9647
9657
  value: function accept(date) {
9648
9658
  ++this.total;
9649
9659
  var tooEarly = this.minDate != null && this.minDate > date;
9660
+ var result;
9650
9661
  if (tooEarly) {
9651
9662
  var maxIterationReached = this.total >= this.maxIterationsAllowed;
9652
- return !maxIterationReached;
9663
+ result = !maxIterationReached;
9653
9664
  } else {
9654
9665
  var tooLate = this.maxDate != null && this.maxDate < date;
9655
9666
  if (tooLate) {
9656
- return true;
9667
+ result = true;
9657
9668
  } else {
9658
9669
  this.add(date);
9659
- return false;
9670
+ result = false;
9660
9671
  }
9661
9672
  }
9673
+ return result;
9662
9674
  }
9663
9675
  },
9664
9676
  {
@@ -9748,7 +9760,8 @@ function _unsupported_iterable_to_array$1(o, minLen) {
9748
9760
  }
9749
9761
  /**
9750
9762
  * Delimiter separating the property name/params from values in an RRule line.
9751
- */ var RRuleStringSplitter = ':';
9763
+ */ var RRULE_STRING_SPLITTER = ':';
9764
+ /** @deprecated use RRULE_STRING_SPLITTER instead. */ var RRuleStringSplitter = RRULE_STRING_SPLITTER;
9752
9765
  /**
9753
9766
  * Utility class for parsing and manipulating RFC 5545 RRule strings.
9754
9767
  *
@@ -9946,18 +9959,20 @@ function _unsupported_iterable_to_array$1(o, minLen) {
9946
9959
  * Splits a raw line at the colon delimiter into params and values portions.
9947
9960
  * Falls back to treating a single-segment line as an RRULE value.
9948
9961
  */ function parseRawLine(line) {
9949
- var _splitJoinRemainder = _sliced_to_array$1(splitJoinRemainder(line, RRuleStringSplitter, 2), 2), params = _splitJoinRemainder[0], values = _splitJoinRemainder[1];
9962
+ var _splitJoinRemainder = _sliced_to_array$1(splitJoinRemainder(line, RRULE_STRING_SPLITTER, 2), 2), params = _splitJoinRemainder[0], values = _splitJoinRemainder[1];
9963
+ var result;
9950
9964
  if (line.length === 1) {
9951
- return {
9965
+ result = {
9952
9966
  params: 'RRULE',
9953
9967
  values: params
9954
9968
  };
9955
9969
  } else {
9956
- return {
9970
+ result = {
9957
9971
  params: params,
9958
9972
  values: values
9959
9973
  };
9960
9974
  }
9975
+ return result;
9961
9976
  }
9962
9977
  },
9963
9978
  {
@@ -10532,4 +10547,4 @@ function _create_class(Constructor, protoProps, staticProps) {
10532
10547
  }
10533
10548
  ();
10534
10549
 
10535
- export { AnyIterResult, CalendarDateType, DATE_CELL_SCHEDULE_ENCODED_WEEK_REGEX, DATE_TODAY_END_VALUE, DATE_TODAY_START_VALUE, DATE_WEEK_END_VALUE, DATE_WEEK_START_VALUE, DEFAULT_EXPAND_DAYS_FOR_DATE_RANGE_MAX_EXPANSION_SIZE, DEFAULT_FULL_DATE_SCHEDULE_RANGE_DURATION, DEFAULT_ITERATE_DAYS_IN_DATE_RANGE_MAX_ITERATIONS, DEFAULT_LAST_ITER_RESULT_MAX_ITERATIONS_ALLOWED, DateCellScheduleDayCode, DateRRule, DateRRuleInstance, DateRRuleParseUtility, DateRRuleUtility, DateRangeType, DateSet, DateTimeMinuteInstance, DateTimeUtilityInstance, DateTimezoneUtcNormalInstance, IterateDaysInDateRangeFunctionBailError, LastIterResult, LimitDateTimeInstance, MAX_FUTURE_DATE, ModelRecurrenceInfoUtility, NextIterResult, RRuleStringSplitter, SYSTEM_DATE_TIMEZONE_UTC_NORMAL_INSTANCE, UNKNOWN_YEAR_WEEK_CODE, UTC_DATE_TIMEZONE_UTC_NORMAL_INSTANCE, allIndexesInDateCellRange, allIndexesInDateCellRanges, allIndexesInDateCellRangesToArray, allKnownTimezoneStrings, allTimezoneInfos, allTimezoneStrings, baseDateToTargetDate, calculateAllConversions, calculateExpectedDateCellTimingDuration, calculateExpectedDateCellTimingDurationPair, calculateTimezoneOffset, calendarDate, calendarDateFactory, calendarDateForDateDurationSpan, calendarDateType, changeDateCellScheduleDateRangeToTimezone, changeDateCellScheduleDateRangeToTimezoneFunction, clampDateFunction, clampDateRangeFunction, clampDateRangeToDateRange, clampDateToDateRange, copyDateCellScheduleDateFilterConfig, copyHoursAndMinutesFromDateWithTimezoneNormal, copyHoursAndMinutesFromNowWithTimezoneNormal, copyHoursAndMinutesFromUTCDate, copyHoursAndMinutesToDate, copyHoursAndMinutesToToday, dateCell, dateCellDayOfWeekFactory, dateCellDayTimingInfoFactory, dateCellDurationSpanHasEndedFilterFunction, dateCellDurationSpanHasNotEndedFilterFunction, dateCellDurationSpanHasNotStartedFilterFunction, dateCellDurationSpanHasStartedFilterFunction, dateCellEndIndex, dateCellIndexRange, dateCellIndexRangeToDateCellRange, dateCellIndexYearWeekCodeFactory, dateCellIndexYearWeekCodeGroupFactory, dateCellIndexsForDateCellScheduleDayCodes, dateCellRange, dateCellRangeBlocksCount, dateCellRangeBlocksCountInfo, dateCellRangeHasRange, dateCellRangeIncludedByRangeFunction, dateCellRangeOfTiming, dateCellRangeOfTimingFactory, dateCellRangeOverlapsRange, dateCellRangeOverlapsRangeFunction, dateCellRangeToDateCellIndexRange, dateCellRangeType, dateCellRangeWithRange, dateCellRangeWithRangeFromIndex, dateCellRangesFullyCoverDateCellRangeFunction, dateCellScheduleDateCellTimingFilter, dateCellScheduleDateFilter, dateCellScheduleDateRange, dateCellScheduleDayCodeFactory, dateCellScheduleDayCodesAreSetsEquivalent, dateCellScheduleDayCodesFromEnabledDays, dateCellScheduleDayCodesSetFromDaysOfWeek, dateCellScheduleEncodedWeek, dateCellScheduleType, dateCellTiming, dateCellTimingCompletedTimeRange, dateCellTimingDateFactory, dateCellTimingDateRange, dateCellTimingEndDateFactory, dateCellTimingEndIndex, dateCellTimingEventRange, dateCellTimingExpansionFactory, dateCellTimingFinalStartsAtEvent, dateCellTimingFromDateCellTimingStartsAtEndRange, dateCellTimingLatestCompletedIndex, dateCellTimingRelativeIndexArrayFactory, dateCellTimingRelativeIndexFactory, dateCellTimingStart, dateCellTimingStartDateFactory, dateCellTimingStartPair, dateCellTimingStartsAtDateFactory, dateCellTimingStartsAtForStartOfDay, dateCellTimingTimezoneNormalInstance, dateCellTimingType, dateCellType, dateDurationSpanEndDate, dateDurationSpanType, dateFromLogicalDate, dateInterval, dateMonthDayStringFormat, dateOrDateRangeToDateRange, dateOrDayStringRangeToDateRange, dateOrDayStringRangeToISO8601DayStringRange, dateRange, dateRangeDaysCount, dateRangeFromStartAndEndOfDay, dateRangeOverlapsDateRange, dateRangeOverlapsDateRangeFunction, dateRangeParamsType, dateRangeRelativeState, dateRangeType, dateRelativeStateForDateCellRangeComparedToIndex, dateShortDateAndTimeStringFormat, dateTimeInstance, dateTimeInstanceUtc, dateTimeMinuteDecisionFunction, dateTimeMinuteWholeDayDecisionFunction, dateTimeStringFormat, dateTimezoneUtcNormal, daysToMinutes, durationSpanDateRelativeState, durationSpanFromDateRange, durationSpanToDateRange, earliestDate, enabledDaysFromDateCellScheduleDayCodes, endItreateDaysInDateRangeEarly, expandDateCellCollection, expandDateCellRange, expandDateCellSchedule, expandDateCellScheduleDayCodes, expandDateCellScheduleDayCodesToDayCodesSet, expandDateCellScheduleDayCodesToDayOfWeekSet, expandDateCellScheduleFactory, expandDateCellScheduleRange, expandDateCellScheduleRangeToDateCellRanges, expandDateCellTiming, expandDaysForDateRange, expandDaysForDateRangeFunction, expandUniqueDateCellsFunction, filterDateCellsInDateCellRange, findMaxDate, findMinDate, findNextDateInDateCellScheduleFilter, fitDateRangeToDayPeriod, fitDateRangeToDayPeriodFunction, fitUTCDateRangeToDayPeriod, forEachDayInDateRange, formatDateDistance, formatDateRange, formatDateRangeDistance, formatDateRangeDistanceFunction, formatDateRangeFunction, formatStartedEndedDistanceString, formatToDateString, formatToDayRangeString, formatToDayTimeRangeString, formatToISO8601DateString, formatToISO8601DayStringForSystem, formatToISO8601DayStringForUTC, formatToMonthDaySlashDate, formatToMonthDayString, formatToShortDateAndTimeString, formatToShortDateString, formatToTimeAndDurationString, formatToTimeRangeString, formatToTimeString, fractionalHoursInDurationSpan, fullDateCellScheduleRange, fullDateCellTiming, fullDateCellTimingTimezonePair, fullWeekDateCellScheduleDayCodes, getCurrentSystemOffsetInHours, getCurrentSystemOffsetInMinutes, getCurrentSystemOffsetInMs, getDateCellTimingFirstEventDateRange, getDateCellTimingHoursInEvent, getDaysOfWeekInDateRange, getGreatestDateCellIndexInDateCellRanges, getLeastAndGreatestDateCellIndexInDateCellRanges, getLeastDateCellIndexInDateCellRanges, getNextDateCellTimingIndex, getRelativeDateForDateCellTiming, getRelativeIndexForDateCellTiming, getTimeAM, getTimezoneAbbreviation, getTimezoneLongName, groupDateRangesByDateRelativeState, groupToDateCellRanges, groupUniqueDateCells, guessCurrentTimezone, hoursToMs, inverseDateTimezoneUtcNormalInstanceTransformType, isAfter, isBefore, isDate, isDateCellRange, isDateCellSchedule, isDateCellScheduleDateRange, isDateCellScheduleEncodedWeek, isDateCellScheduleStartOfDayDateRange, isDateCellTiming, isDateCellTimingRelativeIndexFactory, isDateCellWithinDateCellRange, isDateCellWithinDateCellRangeFunction, isDateInDateRange, isDateInDateRangeFunction, isDateRange, isDateRangeInDateRange, isDateRangeInDateRangeFunction, isDateRangeStart, isDateWithinDateCellRangeFunction, isEmptyDateCellScheduleEncodedWeek, isEndOfDayInUTC, isFullDateCellScheduleDateRange, isFullDateCellTiming, isFullDateRange, isInfiniteDateRange, isKnownTimezone, isLogicalDateStringCode, isMaxFutureDate, isPartialDateRange, isSameDate, isSameDateCellSchedule, isSameDateCellScheduleDateRange, isSameDateCellScheduleEventRange, isSameDateCellTiming, isSameDateCellTimingEventStartsAtEndRange, isSameDateDay, isSameDateDayRange, isSameDateHoursAndMinutes, isSameDateRange, isSameDateTimezoneConversionConfig, isSameDurationSpan, isSameFullDateCellScheduleDateRange, isSameFullDateCellTiming, isStartOfDayForSystem, isStartOfDayInUTC, isValidDateCellIndex, isValidDateCellRange, isValidDateCellRangeSeries, isValidDateCellTiming, isValidDateCellTimingInfo, isValidDateCellTimingStartDate, isValidDateFromTimestringResult, isValidDateTimezoneConversionConfig, isValidFullDateCellTiming, isValidFullDateCellTimingInfo, iterateDaysInDateRange, iterateDaysInDateRangeFunction, knownTimezoneType, latestDate, latestMinute, limitDateTime, limitDateTimeInstance, logicalDateStringCodeDateFactory, makeDateQueryForDateItemRangeFilter, makeDateQueryForDateStartsEndsFilter, makeDateQueryForOccuringFilter, makeDaysAndTimeFiltersFunction, makeMongoDBLikeDateQueryBuilder, maxFutureDate, mergeMongoDBLikeRangeFilters, minutesToMs, modelRecurrenceInfoType, modifyDateCellToFitRange, modifyDateCellsToFitRange, modifyDateCellsToFitRangeFunction, monthDaySlashDateStringFormat, msToMinutes, msToSeconds, nowInterval, parseISO8601DayStringToDate, parseJsDateString, parseReadableTimeString, rawDateCellScheduleDayCodes, readDaysOfWeek, readDaysOfWeekNames, readableTimeStringToDate, reduceDatesFunction, requireCurrentTimezone, roundDateDownTo, roundDateTimeDown, roundDateTimeDownToSteps, roundDateTo, roundDateToDate, roundDateToUnixDateTimeNumber, roundDownToHour, roundDownToMinute, roundToMinuteSteps, safeFormatToISO8601DateString, safeToJsDate, searchTimezoneInfos, setOnDateWithTimezoneNormalFunction, shiftDateCellTimingToSystemTimezone, shiftDateCellTimingToTimezone, shiftDateCellTimingToTimezoneFunction, shiftDateCellTimingToUTCTimezone, simplifyDateCellScheduleDayCodes, sortByDateFunction, sortByISO8601DateStringFunction, sortByISO8601DateStrings, sortDateCellRangeAndSizeFunction, sortDateCellRanges, sortDateRangeStartAscendingCompareFunction, startOfDayInTimezoneDayStringFactory, startOfDayInTimezoneFromISO8601DayString, startOfWeekForYearWeekCode, systemBaseDateToNormalDate, systemBaseDateToNormalDateOffset, systemDateTimezoneUtcNormal, systemExperiencesDaylightSavings, systemNormalDateToBaseDate, systemNormalDateToBaseDateOffset, targetDateToBaseDate, timezoneInfoForSystem, timezoneStringToSearchableString, timezoneStringToTimezoneInfo, toISO8601DayStringForSystem, toISO8601DayStringForUTC, toISODateString, toJsDate, toJsDayDate, toLocalReadableTimeString, toReadableTimeString, transformDateInTimezoneNormalFunction, transformDateRangeDatesFunction, transformDateRangeInTimezoneNormalFunction, transformDateRangeToTimezoneFunction, transformDateRangeWithStartOfDay, updateDateCellTimingToSystemTimezone, updateDateCellTimingToTimezone, updateDateCellTimingToTimezoneFunction, updateDateCellTimingToUTCTimezone, updateDateCellTimingWithDateCellTimingEvent, utcDayForDate, validDateCellRangeSeriesType, validDateCellRangeType, validDateCellTimingType, weekdayDateCellScheduleDayCodes, weekendDateCellScheduleDayCodes, yearWeekCode, yearWeekCodeDateFactory, yearWeekCodeDateTimezoneInstance, yearWeekCodeFactory, yearWeekCodeForCalendarMonth, yearWeekCodeForCalendarMonthFactory, yearWeekCodeForDateRange, yearWeekCodeForDateRangeFactory, yearWeekCodeForDateRangeInTimezone, yearWeekCodeFromDate, yearWeekCodeFromPair, yearWeekCodeGroupFactory, yearWeekCodeIndex, yearWeekCodePair, yearWeekCodePairFromDate };
10550
+ export { AnyIterResult, CalendarDateType, DATE_CELL_SCHEDULE_ENCODED_WEEK_REGEX, DATE_MONTH_DAY_STRING_FORMAT, DATE_SHORT_DATE_AND_TIME_STRING_FORMAT, DATE_TIME_STRING_FORMAT, DATE_TODAY_END_VALUE, DATE_TODAY_START_VALUE, DATE_WEEK_END_VALUE, DATE_WEEK_START_VALUE, DEFAULT_EXPAND_DAYS_FOR_DATE_RANGE_MAX_EXPANSION_SIZE, DEFAULT_FULL_DATE_SCHEDULE_RANGE_DURATION, DEFAULT_ITERATE_DAYS_IN_DATE_RANGE_MAX_ITERATIONS, DEFAULT_LAST_ITER_RESULT_MAX_ITERATIONS_ALLOWED, DateCellScheduleDayCode, DateRRule, DateRRuleInstance, DateRRuleParseUtility, DateRRuleUtility, DateRangeType, DateSet, DateTimeMinuteInstance, DateTimeUtilityInstance, DateTimezoneUtcNormalInstance, IterateDaysInDateRangeFunctionBailError, LastIterResult, LimitDateTimeInstance, MAX_FUTURE_DATE, MONTH_DAY_SLASH_DATE_STRING_FORMAT, ModelRecurrenceInfoUtility, NextIterResult, RRULE_STRING_SPLITTER, RRuleStringSplitter, SYSTEM_DATE_TIMEZONE_UTC_NORMAL_INSTANCE, UNKNOWN_YEAR_WEEK_CODE, UTC_DATE_TIMEZONE_UTC_NORMAL_INSTANCE, allIndexesInDateCellRange, allIndexesInDateCellRanges, allIndexesInDateCellRangesToArray, allKnownTimezoneStrings, allTimezoneInfos, allTimezoneStrings, baseDateToTargetDate, calculateAllConversions, calculateExpectedDateCellTimingDuration, calculateExpectedDateCellTimingDurationPair, calculateTimezoneOffset, calendarDate, calendarDateFactory, calendarDateForDateDurationSpan, calendarDateType, changeDateCellScheduleDateRangeToTimezone, changeDateCellScheduleDateRangeToTimezoneFunction, clampDateFunction, clampDateRangeFunction, clampDateRangeToDateRange, clampDateToDateRange, copyDateCellScheduleDateFilterConfig, copyHoursAndMinutesFromDateWithTimezoneNormal, copyHoursAndMinutesFromNowWithTimezoneNormal, copyHoursAndMinutesFromUTCDate, copyHoursAndMinutesToDate, copyHoursAndMinutesToToday, dateCell, dateCellDayOfWeekFactory, dateCellDayTimingInfoFactory, dateCellDurationSpanHasEndedFilterFunction, dateCellDurationSpanHasNotEndedFilterFunction, dateCellDurationSpanHasNotStartedFilterFunction, dateCellDurationSpanHasStartedFilterFunction, dateCellEndIndex, dateCellIndexRange, dateCellIndexRangeToDateCellRange, dateCellIndexYearWeekCodeFactory, dateCellIndexYearWeekCodeGroupFactory, dateCellIndexsForDateCellScheduleDayCodes, dateCellRange, dateCellRangeBlocksCount, dateCellRangeBlocksCountInfo, dateCellRangeHasRange, dateCellRangeIncludedByRangeFunction, dateCellRangeOfTiming, dateCellRangeOfTimingFactory, dateCellRangeOverlapsRange, dateCellRangeOverlapsRangeFunction, dateCellRangeToDateCellIndexRange, dateCellRangeType, dateCellRangeWithRange, dateCellRangeWithRangeFromIndex, dateCellRangesFullyCoverDateCellRangeFunction, dateCellScheduleDateCellTimingFilter, dateCellScheduleDateFilter, dateCellScheduleDateRange, dateCellScheduleDayCodeFactory, dateCellScheduleDayCodesAreSetsEquivalent, dateCellScheduleDayCodesFromEnabledDays, dateCellScheduleDayCodesSetFromDaysOfWeek, dateCellScheduleEncodedWeek, dateCellScheduleType, dateCellTiming, dateCellTimingCompletedTimeRange, dateCellTimingDateFactory, dateCellTimingDateRange, dateCellTimingEndDateFactory, dateCellTimingEndIndex, dateCellTimingEventRange, dateCellTimingExpansionFactory, dateCellTimingFinalStartsAtEvent, dateCellTimingFromDateCellTimingStartsAtEndRange, dateCellTimingLatestCompletedIndex, dateCellTimingRelativeIndexArrayFactory, dateCellTimingRelativeIndexFactory, dateCellTimingStart, dateCellTimingStartDateFactory, dateCellTimingStartPair, dateCellTimingStartsAtDateFactory, dateCellTimingStartsAtForStartOfDay, dateCellTimingTimezoneNormalInstance, dateCellTimingType, dateCellType, dateDurationSpanEndDate, dateDurationSpanType, dateFromLogicalDate, dateInterval, dateMonthDayStringFormat, dateOrDateRangeToDateRange, dateOrDayStringRangeToDateRange, dateOrDayStringRangeToISO8601DayStringRange, dateRange, dateRangeDaysCount, dateRangeFromStartAndEndOfDay, dateRangeOverlapsDateRange, dateRangeOverlapsDateRangeFunction, dateRangeParamsType, dateRangeRelativeState, dateRangeType, dateRelativeStateForDateCellRangeComparedToIndex, dateShortDateAndTimeStringFormat, dateTimeInstance, dateTimeInstanceUtc, dateTimeMinuteDecisionFunction, dateTimeMinuteWholeDayDecisionFunction, dateTimeStringFormat, dateTimezoneUtcNormal, daysToMinutes, durationSpanDateRelativeState, durationSpanFromDateRange, durationSpanToDateRange, earliestDate, enabledDaysFromDateCellScheduleDayCodes, endItreateDaysInDateRangeEarly, expandDateCellCollection, expandDateCellRange, expandDateCellSchedule, expandDateCellScheduleDayCodes, expandDateCellScheduleDayCodesToDayCodesSet, expandDateCellScheduleDayCodesToDayOfWeekSet, expandDateCellScheduleFactory, expandDateCellScheduleRange, expandDateCellScheduleRangeToDateCellRanges, expandDateCellTiming, expandDaysForDateRange, expandDaysForDateRangeFunction, expandUniqueDateCellsFunction, filterDateCellsInDateCellRange, findMaxDate, findMinDate, findNextDateInDateCellScheduleFilter, fitDateRangeToDayPeriod, fitDateRangeToDayPeriodFunction, fitUTCDateRangeToDayPeriod, forEachDayInDateRange, formatDateDistance, formatDateRange, formatDateRangeDistance, formatDateRangeDistanceFunction, formatDateRangeFunction, formatStartedEndedDistanceString, formatToDateString, formatToDayRangeString, formatToDayTimeRangeString, formatToISO8601DateString, formatToISO8601DayStringForSystem, formatToISO8601DayStringForUTC, formatToMonthDaySlashDate, formatToMonthDayString, formatToShortDateAndTimeString, formatToShortDateString, formatToTimeAndDurationString, formatToTimeRangeString, formatToTimeString, fractionalHoursInDurationSpan, fullDateCellScheduleRange, fullDateCellTiming, fullDateCellTimingTimezonePair, fullWeekDateCellScheduleDayCodes, getCurrentSystemOffsetInHours, getCurrentSystemOffsetInMinutes, getCurrentSystemOffsetInMs, getDateCellTimingFirstEventDateRange, getDateCellTimingHoursInEvent, getDaysOfWeekInDateRange, getGreatestDateCellIndexInDateCellRanges, getLeastAndGreatestDateCellIndexInDateCellRanges, getLeastDateCellIndexInDateCellRanges, getNextDateCellTimingIndex, getRelativeDateForDateCellTiming, getRelativeIndexForDateCellTiming, getTimeAM, getTimezoneAbbreviation, getTimezoneLongName, groupDateRangesByDateRelativeState, groupToDateCellRanges, groupUniqueDateCells, guessCurrentTimezone, hoursToMs, inverseDateTimezoneUtcNormalInstanceTransformType, isAfter, isBefore, isDate, isDateCellRange, isDateCellSchedule, isDateCellScheduleDateRange, isDateCellScheduleEncodedWeek, isDateCellScheduleStartOfDayDateRange, isDateCellTiming, isDateCellTimingRelativeIndexFactory, isDateCellWithinDateCellRange, isDateCellWithinDateCellRangeFunction, isDateInDateRange, isDateInDateRangeFunction, isDateRange, isDateRangeInDateRange, isDateRangeInDateRangeFunction, isDateRangeStart, isDateWithinDateCellRangeFunction, isEmptyDateCellScheduleEncodedWeek, isEndOfDayInUTC, isFullDateCellScheduleDateRange, isFullDateCellTiming, isFullDateRange, isInfiniteDateRange, isKnownTimezone, isLogicalDateStringCode, isMaxFutureDate, isPartialDateRange, isSameDate, isSameDateCellSchedule, isSameDateCellScheduleDateRange, isSameDateCellScheduleEventRange, isSameDateCellTiming, isSameDateCellTimingEventStartsAtEndRange, isSameDateDay, isSameDateDayRange, isSameDateHoursAndMinutes, isSameDateRange, isSameDateTimezoneConversionConfig, isSameDurationSpan, isSameFullDateCellScheduleDateRange, isSameFullDateCellTiming, isStartOfDayForSystem, isStartOfDayInUTC, isValidDateCellIndex, isValidDateCellRange, isValidDateCellRangeSeries, isValidDateCellTiming, isValidDateCellTimingInfo, isValidDateCellTimingStartDate, isValidDateFromTimestringResult, isValidDateTimezoneConversionConfig, isValidFullDateCellTiming, isValidFullDateCellTimingInfo, iterateDaysInDateRange, iterateDaysInDateRangeFunction, knownTimezoneType, latestDate, latestMinute, limitDateTime, limitDateTimeInstance, logicalDateStringCodeDateFactory, makeDateQueryForDateItemRangeFilter, makeDateQueryForDateStartsEndsFilter, makeDateQueryForOccuringFilter, makeDaysAndTimeFiltersFunction, makeMongoDBLikeDateQueryBuilder, maxFutureDate, mergeMongoDBLikeRangeFilters, minutesToMs, modelRecurrenceInfoType, modifyDateCellToFitRange, modifyDateCellsToFitRange, modifyDateCellsToFitRangeFunction, monthDaySlashDateStringFormat, msToMinutes, msToSeconds, nowInterval, parseISO8601DayStringToDate, parseJsDateString, parseReadableTimeString, rawDateCellScheduleDayCodes, readDaysOfWeek, readDaysOfWeekNames, readableTimeStringToDate, reduceDatesFunction, requireCurrentTimezone, roundDateDownTo, roundDateTimeDown, roundDateTimeDownToSteps, roundDateTo, roundDateToDate, roundDateToUnixDateTimeNumber, roundDownToHour, roundDownToMinute, roundToMinuteSteps, safeFormatToISO8601DateString, safeToJsDate, searchTimezoneInfos, setOnDateWithTimezoneNormalFunction, shiftDateCellTimingToSystemTimezone, shiftDateCellTimingToTimezone, shiftDateCellTimingToTimezoneFunction, shiftDateCellTimingToUTCTimezone, simplifyDateCellScheduleDayCodes, sortByDateFunction, sortByISO8601DateStringFunction, sortByISO8601DateStrings, sortDateCellRangeAndSizeFunction, sortDateCellRanges, sortDateRangeStartAscendingCompareFunction, startOfDayInTimezoneDayStringFactory, startOfDayInTimezoneFromISO8601DayString, startOfWeekForYearWeekCode, systemBaseDateToNormalDate, systemBaseDateToNormalDateOffset, systemDateTimezoneUtcNormal, systemExperiencesDaylightSavings, systemNormalDateToBaseDate, systemNormalDateToBaseDateOffset, targetDateToBaseDate, timezoneInfoForSystem, timezoneStringToSearchableString, timezoneStringToTimezoneInfo, toISO8601DayStringForSystem, toISO8601DayStringForUTC, toISODateString, toJsDate, toJsDayDate, toLocalReadableTimeString, toReadableTimeString, transformDateInTimezoneNormalFunction, transformDateRangeDatesFunction, transformDateRangeInTimezoneNormalFunction, transformDateRangeToTimezoneFunction, transformDateRangeWithStartOfDay, updateDateCellTimingToSystemTimezone, updateDateCellTimingToTimezone, updateDateCellTimingToTimezoneFunction, updateDateCellTimingToUTCTimezone, updateDateCellTimingWithDateCellTimingEvent, utcDayForDate, validDateCellRangeSeriesType, validDateCellRangeType, validDateCellTimingType, weekdayDateCellScheduleDayCodes, weekendDateCellScheduleDayCodes, yearWeekCode, yearWeekCodeDateFactory, yearWeekCodeDateTimezoneInstance, yearWeekCodeFactory, yearWeekCodeForCalendarMonth, yearWeekCodeForCalendarMonthFactory, yearWeekCodeForDateRange, yearWeekCodeForDateRangeFactory, yearWeekCodeForDateRangeInTimezone, yearWeekCodeFromDate, yearWeekCodeFromPair, yearWeekCodeGroupFactory, yearWeekCodeIndex, yearWeekCodePair, yearWeekCodePairFromDate };
package/package.json CHANGED
@@ -1,9 +1,10 @@
1
1
  {
2
2
  "name": "@dereekb/date",
3
- "version": "13.3.0",
3
+ "version": "13.4.0",
4
4
  "peerDependencies": {
5
- "@dereekb/rxjs": "13.3.0",
6
- "@dereekb/util": "13.3.0",
5
+ "@dereekb/model": "13.4.0",
6
+ "@dereekb/rxjs": "13.4.0",
7
+ "@dereekb/util": "13.4.0",
7
8
  "@vvo/tzdb": "^6.0.0",
8
9
  "arktype": "^2.2.0",
9
10
  "date-fns": "^4.0.0",
@@ -13,7 +14,7 @@
13
14
  },
14
15
  "dependencies": {},
15
16
  "devDependencies": {
16
- "@dereekb/rxjs": "13.3.0"
17
+ "@dereekb/rxjs": "13.4.0"
17
18
  },
18
19
  "exports": {
19
20
  "./package.json": "./package.json",
@@ -1,4 +1,4 @@
1
- import { type ISO8601DayString } from '@dereekb/util';
1
+ import { type ISO8601DayString, type TimezoneString } from '@dereekb/util';
2
2
  import { type DateDurationSpan } from './date.duration';
3
3
  /**
4
4
  * Distinguishes between time-based calendar events and all-day/multi-day events.
@@ -31,7 +31,7 @@ export interface CalendarDateConfig {
31
31
  * If defined, will apply the target timezone's offset.
32
32
  * If false, will be generated in UTC.
33
33
  */
34
- timezone?: string | false;
34
+ readonly timezone?: TimezoneString | false;
35
35
  }
36
36
  /**
37
37
  * Creates a {@link CalendarDate} from a day string and optional multi-day span.
@@ -71,7 +71,7 @@ export declare function calendarDateFactory(config?: CalendarDateConfig): Calend
71
71
  * // event.type === CalendarDateType.DAYS
72
72
  * ```
73
73
  */
74
- export declare function calendarDate(day: ISO8601DayString, days?: number, timezone?: string | false): CalendarDate;
74
+ export declare function calendarDate(day: ISO8601DayString, days?: number, timezone?: TimezoneString | false): CalendarDate;
75
75
  /**
76
76
  * Wraps an existing {@link DateDurationSpan} as a time-based {@link CalendarDate}.
77
77
  *
@@ -94,7 +94,7 @@ export interface YearMonthDayCodeConfig {
94
94
  *
95
95
  * Configured to use the system timezone by default.
96
96
  */
97
- timezone?: YearMonthDayCodeDateTimezoneInput;
97
+ readonly timezone?: YearMonthDayCodeDateTimezoneInput;
98
98
  }
99
99
  /**
100
100
  * Resolves a {@link YearMonthDayCodeDateTimezoneInput} into a {@link DateTimezoneUtcNormalInstance},
@@ -221,11 +221,11 @@ export interface YearMonthDayCodeGroupFactoryConfig<B> {
221
221
  * Factory or config used to convert dates to day codes. Accepts either a pre-built
222
222
  * {@link YearMonthDayCodeFactory} or raw {@link YearMonthDayCodeConfig} to create one.
223
223
  */
224
- yearMonthDayCodeFactory?: YearMonthDayCodeFactory | YearMonthDayCodeConfig;
224
+ readonly yearMonthDayCodeFactory?: YearMonthDayCodeFactory | YearMonthDayCodeConfig;
225
225
  /**
226
226
  * Function that extracts the relevant Date from each item for day-code grouping.
227
227
  */
228
- dateReader: YearMonthDayCodeDateReader<B>;
228
+ readonly dateReader: YearMonthDayCodeDateReader<B>;
229
229
  }
230
230
  /**
231
231
  * Creates a {@link YearMonthDayCodeGroupFactory} that partitions items into day-based groups.
@@ -22,21 +22,21 @@ export interface FormatDateRangeFunctionConfig {
22
22
  /**
23
23
  * Function used to format each individual date in the range.
24
24
  */
25
- format: FormatDateFunction;
25
+ readonly format: FormatDateFunction;
26
26
  /**
27
27
  * Whether to normalize dates to UTC before formatting.
28
28
  */
29
- normalizeToUTC?: boolean;
29
+ readonly normalizeToUTC?: boolean;
30
30
  /**
31
31
  * Separator string placed between the formatted start and end dates. Defaults to `'-'`.
32
32
  */
33
- separator?: string;
33
+ readonly separator?: string;
34
34
  /**
35
35
  * Whether to output a single formatted date when both dates fall on the same day.
36
36
  *
37
37
  * False by default.
38
38
  */
39
- simplifySameDate?: boolean;
39
+ readonly simplifySameDate?: boolean;
40
40
  }
41
41
  export type FormatDateRangeFunctionConfigInput = FormatDateFunction | FormatDateRangeFunctionConfig;
42
42
  /**
@@ -315,6 +315,8 @@ export declare function toISO8601DayStringForUTC(dateOrString: DateOrDayString):
315
315
  */
316
316
  export declare function formatToISO8601DayStringForUTC(date?: Date): ISO8601DayString;
317
317
  /** date-fns format string for `MM/dd/yyyy` (e.g., `"01/15/2024"`). */
318
+ export declare const MONTH_DAY_SLASH_DATE_STRING_FORMAT = "MM/dd/yyyy";
319
+ /** @deprecated use MONTH_DAY_SLASH_DATE_STRING_FORMAT instead. */
318
320
  export declare const monthDaySlashDateStringFormat = "MM/dd/yyyy";
319
321
  /**
320
322
  * Formats a Date as a month/day/year slash-separated string (`MM/dd/yyyy`). Defaults to the current date.
@@ -335,6 +337,8 @@ export declare function formatToMonthDaySlashDate(date?: Date): MonthDaySlashDat
335
337
  */
336
338
  export declare const formatToShortDateString: typeof formatToMonthDaySlashDate;
337
339
  /** date-fns format string for `MM/dd` (e.g., `"01/15"`). */
340
+ export declare const DATE_MONTH_DAY_STRING_FORMAT = "MM/dd";
341
+ /** @deprecated use DATE_MONTH_DAY_STRING_FORMAT instead. */
338
342
  export declare const dateMonthDayStringFormat = "MM/dd";
339
343
  /**
340
344
  * Formats a Date as a month/day string (`MM/dd`) without the year. Defaults to the current date.
@@ -365,6 +369,8 @@ export declare function formatToMonthDayString(date?: Date): ISO8601DayString;
365
369
  */
366
370
  export declare function formatToDateString(date: Date): string;
367
371
  /** date-fns format string for 12-hour time with AM/PM (e.g., `"9:00 AM"`). */
372
+ export declare const DATE_TIME_STRING_FORMAT = "h:mm a";
373
+ /** @deprecated use DATE_TIME_STRING_FORMAT instead. */
368
374
  export declare const dateTimeStringFormat = "h:mm a";
369
375
  /**
370
376
  * Formats a Date as a 12-hour time string with AM/PM (e.g., `"9:00 AM"`).
@@ -381,6 +387,8 @@ export declare const dateTimeStringFormat = "h:mm a";
381
387
  */
382
388
  export declare function formatToTimeString(date: Date): string;
383
389
  /** Combined date-fns format string for `MM/dd/yyyy h:mm a` (e.g., `"01/15/2024 9:00 AM"`). */
390
+ export declare const DATE_SHORT_DATE_AND_TIME_STRING_FORMAT = "MM/dd/yyyy h:mm a";
391
+ /** @deprecated use DATE_SHORT_DATE_AND_TIME_STRING_FORMAT instead. */
384
392
  export declare const dateShortDateAndTimeStringFormat = "MM/dd/yyyy h:mm a";
385
393
  /**
386
394
  * Formats a Date as a short date and time string (e.g., `"01/15/2024 9:00 AM"`).
@@ -343,7 +343,7 @@ export interface ExpandDaysForDateRangeConfig {
343
343
  *
344
344
  * Defaults to 1500 days.
345
345
  */
346
- maxExpansionSize?: number | 0 | false;
346
+ readonly maxExpansionSize?: number | 0 | false;
347
347
  }
348
348
  export declare const DEFAULT_EXPAND_DAYS_FOR_DATE_RANGE_MAX_EXPANSION_SIZE = 1500;
349
349
  export type ExpandDaysForDateRangeFunction = FactoryWithRequiredInput<Date[], DateRange>;
@@ -104,7 +104,7 @@ export interface YearWeekCodeConfig {
104
104
  *
105
105
  * Configured to use the system timezone by default.
106
106
  */
107
- timezone?: YearWeekCodeDateTimezoneInput;
107
+ readonly timezone?: YearWeekCodeDateTimezoneInput;
108
108
  }
109
109
  /**
110
110
  * Resolves a timezone input into a {@link DateTimezoneUtcNormalInstance} for use with YearWeekCode calculations.
@@ -232,9 +232,9 @@ export type YearWeekCodeGroupFactory<B> = (items: B[]) => YearWeekCodeGroup<B>[]
232
232
  export type YearWeekCodeDateReader<B> = MapFunction<B, Maybe<Date | YearWeekCode | YearWeekCodeString>>;
233
233
  export type YearWeekCodeReader = MapFunction<YearWeekCode | YearWeekCodeString, YearWeekCode>;
234
234
  export interface YearWeekCodeGroupFactoryConfig<B> {
235
- yearWeekCodeFactory?: YearWeekCodeFactory | YearWeekCodeConfig;
236
- yearWeekCodeReader?: YearWeekCodeReader;
237
- dateReader: YearWeekCodeDateReader<B>;
235
+ readonly yearWeekCodeFactory?: YearWeekCodeFactory | YearWeekCodeConfig;
236
+ readonly yearWeekCodeReader?: YearWeekCodeReader;
237
+ readonly dateReader: YearWeekCodeDateReader<B>;
238
238
  }
239
239
  /**
240
240
  * Creates a {@link YearWeekCodeGroupFactory} that groups items by their {@link YearWeekCode}.
@@ -102,6 +102,8 @@ export interface RRuleExdateAttribute {
102
102
  /**
103
103
  * Delimiter separating the property name/params from values in an RRule line.
104
104
  */
105
+ export declare const RRULE_STRING_SPLITTER = ":";
106
+ /** @deprecated use RRULE_STRING_SPLITTER instead. */
105
107
  export declare const RRuleStringSplitter = ":";
106
108
  /**
107
109
  * Utility class for parsing and manipulating RFC 5545 RRule strings.