@dereekb/date 13.6.14 → 13.6.16

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
@@ -7287,9 +7287,30 @@ var DATE_CELL_SCHEDULE_ENCODED_WEEK_REGEX = /^[0-9]{0,9}$/;
7287
7287
  }).expectedFinalStartsAt;
7288
7288
  end = expectedFinalStartsAt;
7289
7289
  }
7290
+ var systemNormalInstance = dateTimezoneUtcNormal({
7291
+ useSystemTimezone: true
7292
+ });
7293
+ /**
7294
+ * Converts a minMaxDateRange Date or index to a day index. For Date inputs, extracts the calendar day
7295
+ * from the system timezone as an ISO8601 day string to avoid cross-timezone day boundary issues.
7296
+ */ function _minMaxDateRangeDateOrIndexToIndex(input) {
7297
+ var result;
7298
+ if (typeof input === 'number') {
7299
+ result = input;
7300
+ } else {
7301
+ var dayString = formatToISO8601DayStringForUTC(systemNormalInstance.baseDateToTargetDate(input));
7302
+ result = _dateCellTimingRelativeIndexFactory(dayString);
7303
+ }
7304
+ return result;
7305
+ }
7290
7306
  var indexFloor = setStartAsMinDate ? 0 : Number.MIN_SAFE_INTEGER;
7291
- var minAllowedIndex = (minMaxDateRange === null || minMaxDateRange === void 0 ? void 0 : minMaxDateRange.start) != null ? Math.max(indexFloor, _dateCellTimingRelativeIndexFactory(minMaxDateRange.start)) : indexFloor; // start date should be the min inde
7292
- var maxAllowedIndex = end != null ? _dateCellTimingRelativeIndexFactory(end) : (minMaxDateRange === null || minMaxDateRange === void 0 ? void 0 : minMaxDateRange.end) != null ? _dateCellTimingRelativeIndexFactory(minMaxDateRange.end) : Number.MAX_SAFE_INTEGER; // max "to" value
7307
+ // When minMaxDateRange contains Date values, the calendar store applies startOfDay() in the system timezone.
7308
+ // If the system timezone differs from the filter timezone (e.g., system in CDT but job in MDT), the Date's UTC
7309
+ // time may map to the wrong day in the filter timezone via baseDateToTargetDate. To fix this, extract the
7310
+ // intended calendar day from the system timezone as an ISO8601 day string, then use the index factory's
7311
+ // string path which correctly computes the day offset in UTC-normal space.
7312
+ var minAllowedIndex = (minMaxDateRange === null || minMaxDateRange === void 0 ? void 0 : minMaxDateRange.start) != null ? Math.max(indexFloor, _minMaxDateRangeDateOrIndexToIndex(minMaxDateRange.start)) : indexFloor;
7313
+ var maxAllowedIndex = end != null ? _dateCellTimingRelativeIndexFactory(end) : (minMaxDateRange === null || minMaxDateRange === void 0 ? void 0 : minMaxDateRange.end) != null ? Math.max(indexFloor, _minMaxDateRangeDateOrIndexToIndex(minMaxDateRange.end)) : Number.MAX_SAFE_INTEGER;
7293
7314
  var includedIndexes = new Set(config.d);
7294
7315
  var excludedIndexes = new Set(config.ex);
7295
7316
  var fn = function fn(input) {
package/index.esm.js CHANGED
@@ -7286,9 +7286,30 @@ var DATE_CELL_SCHEDULE_ENCODED_WEEK_REGEX = /^[0-9]{0,9}$/;
7286
7286
  }).expectedFinalStartsAt;
7287
7287
  end = expectedFinalStartsAt;
7288
7288
  }
7289
+ var systemNormalInstance = dateTimezoneUtcNormal({
7290
+ useSystemTimezone: true
7291
+ });
7292
+ /**
7293
+ * Converts a minMaxDateRange Date or index to a day index. For Date inputs, extracts the calendar day
7294
+ * from the system timezone as an ISO8601 day string to avoid cross-timezone day boundary issues.
7295
+ */ function _minMaxDateRangeDateOrIndexToIndex(input) {
7296
+ var result;
7297
+ if (typeof input === 'number') {
7298
+ result = input;
7299
+ } else {
7300
+ var dayString = formatToISO8601DayStringForUTC(systemNormalInstance.baseDateToTargetDate(input));
7301
+ result = _dateCellTimingRelativeIndexFactory(dayString);
7302
+ }
7303
+ return result;
7304
+ }
7289
7305
  var indexFloor = setStartAsMinDate ? 0 : Number.MIN_SAFE_INTEGER;
7290
- var minAllowedIndex = (minMaxDateRange === null || minMaxDateRange === void 0 ? void 0 : minMaxDateRange.start) != null ? Math.max(indexFloor, _dateCellTimingRelativeIndexFactory(minMaxDateRange.start)) : indexFloor; // start date should be the min inde
7291
- var maxAllowedIndex = end != null ? _dateCellTimingRelativeIndexFactory(end) : (minMaxDateRange === null || minMaxDateRange === void 0 ? void 0 : minMaxDateRange.end) != null ? _dateCellTimingRelativeIndexFactory(minMaxDateRange.end) : Number.MAX_SAFE_INTEGER; // max "to" value
7306
+ // When minMaxDateRange contains Date values, the calendar store applies startOfDay() in the system timezone.
7307
+ // If the system timezone differs from the filter timezone (e.g., system in CDT but job in MDT), the Date's UTC
7308
+ // time may map to the wrong day in the filter timezone via baseDateToTargetDate. To fix this, extract the
7309
+ // intended calendar day from the system timezone as an ISO8601 day string, then use the index factory's
7310
+ // string path which correctly computes the day offset in UTC-normal space.
7311
+ var minAllowedIndex = (minMaxDateRange === null || minMaxDateRange === void 0 ? void 0 : minMaxDateRange.start) != null ? Math.max(indexFloor, _minMaxDateRangeDateOrIndexToIndex(minMaxDateRange.start)) : indexFloor;
7312
+ var maxAllowedIndex = end != null ? _dateCellTimingRelativeIndexFactory(end) : (minMaxDateRange === null || minMaxDateRange === void 0 ? void 0 : minMaxDateRange.end) != null ? Math.max(indexFloor, _minMaxDateRangeDateOrIndexToIndex(minMaxDateRange.end)) : Number.MAX_SAFE_INTEGER;
7292
7313
  var includedIndexes = new Set(config.d);
7293
7314
  var excludedIndexes = new Set(config.ex);
7294
7315
  var fn = function fn(input) {
package/package.json CHANGED
@@ -1,10 +1,10 @@
1
1
  {
2
2
  "name": "@dereekb/date",
3
- "version": "13.6.14",
3
+ "version": "13.6.16",
4
4
  "peerDependencies": {
5
- "@dereekb/model": "13.6.14",
6
- "@dereekb/rxjs": "13.6.14",
7
- "@dereekb/util": "13.6.14",
5
+ "@dereekb/model": "13.6.16",
6
+ "@dereekb/rxjs": "13.6.16",
7
+ "@dereekb/util": "13.6.16",
8
8
  "@vvo/tzdb": "^6.0.0",
9
9
  "arktype": "^2.2.0",
10
10
  "date-fns": "^4.0.0",
@@ -14,7 +14,7 @@
14
14
  },
15
15
  "dependencies": {},
16
16
  "devDependencies": {
17
- "@dereekb/rxjs": "13.6.14"
17
+ "@dereekb/rxjs": "13.6.16"
18
18
  },
19
19
  "exports": {
20
20
  "./package.json": "./package.json",