@simplybusiness/mobius-datepicker 6.5.23 → 6.5.25

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,19 @@
1
1
  # Changelog
2
2
 
3
+ ## 6.5.25
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies [cce2025]
8
+ - @simplybusiness/icons@4.25.0
9
+ - @simplybusiness/mobius@5.28.3
10
+
11
+ ## 6.5.24
12
+
13
+ ### Patch Changes
14
+
15
+ - fcfb99e: fix: Use local time for date modal
16
+
3
17
  ## 6.5.23
4
18
 
5
19
  ### Patch Changes
package/dist/cjs/index.js CHANGED
@@ -189,6 +189,20 @@ var init_getStartWeekday = __esm({
189
189
  }
190
190
  });
191
191
 
192
+ // src/components/DatePicker/utils/timezoneOffset.ts
193
+ function toLocal(utcDateString) {
194
+ const utcDate = new Date(utcDateString);
195
+ if (Number.isNaN(utcDate.getTime())) {
196
+ throw new Error("Invalid date string");
197
+ }
198
+ return new Date(utcDate.getTime() + utcDate.getTimezoneOffset() * 6e4);
199
+ }
200
+ var init_timezoneOffset = __esm({
201
+ "src/components/DatePicker/utils/timezoneOffset.ts"() {
202
+ "use strict";
203
+ }
204
+ });
205
+
192
206
  // src/components/DatePicker/DatePickerModal.tsx
193
207
  var DatePickerModal_exports = {};
194
208
  __export(DatePickerModal_exports, {
@@ -208,6 +222,7 @@ var init_DatePickerModal = __esm({
208
222
  init_useFocusTrap();
209
223
  init_utils();
210
224
  init_getStartWeekday();
225
+ init_timezoneOffset();
211
226
  import_jsx_runtime2 = require("react/jsx-runtime");
212
227
  PARENT_NODE = typeof document !== "undefined" && document.body;
213
228
  ChevronComponent = ({
@@ -228,9 +243,9 @@ var init_DatePickerModal = __esm({
228
243
  max
229
244
  }) => {
230
245
  const modalRef = (0, import_react2.useRef)(null);
231
- const initialDate = date ? new Date(date) : void 0;
232
- const minDate = min ? new Date(min) : void 0;
233
- const maxDate = max ? new Date(max) : void 0;
246
+ const initialDate = date ? toLocal(date) : void 0;
247
+ const minDate = min ? toLocal(min) : void 0;
248
+ const maxDate = max ? toLocal(max) : void 0;
234
249
  const hiddenId = `screen-reader-title-${(0, import_react2.useId)()}`;
235
250
  if (isOpen && PARENT_NODE) {
236
251
  PARENT_NODE?.setAttribute("aria-hidden", "true");