@connectif/ui-components 2.3.3 → 2.3.4

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/dist/index.js CHANGED
@@ -16024,10 +16024,15 @@ function formatDate(date, locale, timezone, format2) {
16024
16024
  const options = getDateTimeFormatOptions(timezone, format2);
16025
16025
  return new Intl.DateTimeFormat(locale, options).format(date);
16026
16026
  }
16027
- function getWeekDayNamesForLocale(locale, format2 = "long") {
16028
- const f = new Intl.DateTimeFormat(locale, { weekday: format2 }).format;
16029
- return Array.from(Array(7).keys()).map(
16030
- (day) => f(new Date(Date.UTC(2021, 5, day)))
16027
+ function getWeekDayNamesForLocale(locale, format2 = "long", timezone = "UTC") {
16028
+ const formatter = new Intl.DateTimeFormat(locale, {
16029
+ weekday: format2,
16030
+ timeZone: timezone
16031
+ }).format;
16032
+ const mondayAnchor = tz({ year: 2021, month: 5, date: 7 }, timezone);
16033
+ return Array.from(
16034
+ { length: 7 },
16035
+ (_v, i) => formatter(mondayAnchor.clone().add(i, "day").toDate())
16031
16036
  );
16032
16037
  }
16033
16038
  function getDateInputFormatForLocale(locale) {
@@ -19254,14 +19259,14 @@ var CalendarMonth_default = CalendarMonth;
19254
19259
  import * as React53 from "react";
19255
19260
  import { jsx as jsx103 } from "react/jsx-runtime";
19256
19261
  var DaysOfWeekRow = () => {
19257
- const { locale } = React53.useContext(IntlContext);
19262
+ const { locale, timezone } = React53.useContext(IntlContext);
19258
19263
  const daysOfWeekLong = React53.useMemo(
19259
- () => getWeekDayNamesForLocale(locale, "long"),
19260
- [locale]
19264
+ () => getWeekDayNamesForLocale(locale, "long", timezone),
19265
+ [locale, timezone]
19261
19266
  );
19262
19267
  const daysOfWeek = React53.useMemo(
19263
- () => getWeekDayNamesForLocale(locale, "narrow"),
19264
- [locale]
19268
+ () => getWeekDayNamesForLocale(locale, "narrow", timezone),
19269
+ [locale, timezone]
19265
19270
  );
19266
19271
  return /* @__PURE__ */ jsx103(
19267
19272
  Stack_default,
@@ -20726,14 +20731,14 @@ var TimezoneSelector_default = TimezoneSelector;
20726
20731
  import * as React59 from "react";
20727
20732
  import { jsx as jsx112 } from "react/jsx-runtime";
20728
20733
  var DaysOfWeekPicker = ({ value, onChange }) => {
20729
- const { locale } = React59.useContext(IntlContext);
20734
+ const { locale, timezone } = React59.useContext(IntlContext);
20730
20735
  const daysOfWeekLong = React59.useMemo(
20731
- () => getWeekDayNamesForLocale(locale, "long"),
20732
- [locale]
20736
+ () => getWeekDayNamesForLocale(locale, "long", timezone),
20737
+ [locale, timezone]
20733
20738
  );
20734
20739
  const daysOfWeek = React59.useMemo(
20735
- () => getWeekDayNamesForLocale(locale, "narrow"),
20736
- [locale]
20740
+ () => getWeekDayNamesForLocale(locale, "narrow", timezone),
20741
+ [locale, timezone]
20737
20742
  );
20738
20743
  const daysOfWeekValues = [
20739
20744
  "monday",