@headless-adminapp/fluent 0.0.17-alpha.24 → 0.0.17-alpha.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.
@@ -73,7 +73,7 @@ function useTableColumns({ disableSelection, disableContextMenu, disableColumnRe
73
73
  const router = (0, hooks_5.useRouter)();
74
74
  const recordSetSetter = (0, hooks_4.useRecordSetSetter)();
75
75
  const openRecord = (0, useOpenRecord_1.useOpenRecord)();
76
- const { currency, dateFormats } = (0, locale_1.useLocale)();
76
+ const { currency, dateFormats, timezone } = (0, locale_1.useLocale)();
77
77
  const dataRef = (0, react_1.useRef)(data);
78
78
  dataRef.current = data;
79
79
  const headingSelectionState = (0, react_1.useMemo)(() => {
@@ -169,6 +169,7 @@ function useTableColumns({ disableSelection, disableContextMenu, disableColumnRe
169
169
  const formattedValue = (_c = (0, utils_1.getAttributeFormattedValue)(attribute, value, {
170
170
  currency: currency.currency,
171
171
  dateFormat: dateFormats.short,
172
+ timezone,
172
173
  })) !== null && _c !== void 0 ? _c : '';
173
174
  if (schema.primaryAttribute === column.name) {
174
175
  const path = routeResolver({
@@ -257,5 +258,6 @@ function useTableColumns({ disableSelection, disableContextMenu, disableColumnRe
257
258
  router,
258
259
  mutableContextCommandState,
259
260
  headingSelectionState,
261
+ timezone,
260
262
  ]);
261
263
  }
@@ -27,7 +27,7 @@ const Item = ({ item, toasterId, }) => {
27
27
  return;
28
28
  }
29
29
  opened.current = true;
30
- dispatchToast((0, jsx_runtime_1.jsxs)(react_components_1.Toast, { children: [!!item.title && (0, jsx_runtime_1.jsx)(react_components_1.ToastTitle, { children: item.title }), (0, jsx_runtime_1.jsx)(react_components_1.ToastBody, { children: item.text }), !!((_a = item.actions) === null || _a === void 0 ? void 0 : _a.length) && ((0, jsx_runtime_1.jsx)(react_components_1.ToastFooter, { children: item.actions.map((action, index) => ((0, jsx_runtime_1.jsx)(react_components_1.Link, { onClick: action.onClick, children: action.text }, index))) }))] }), {
30
+ dispatchToast((0, jsx_runtime_1.jsxs)(react_components_1.Toast, { children: [(0, jsx_runtime_1.jsx)(react_components_1.ToastTitle, { children: item.title }), (0, jsx_runtime_1.jsx)(react_components_1.ToastBody, { children: item.text }), !!((_a = item.actions) === null || _a === void 0 ? void 0 : _a.length) && ((0, jsx_runtime_1.jsx)(react_components_1.ToastFooter, { children: item.actions.map((action, index) => ((0, jsx_runtime_1.jsx)(react_components_1.Link, { onClick: action.onClick, children: action.text }, index))) }))] }), {
31
31
  timeout: 2000,
32
32
  intent: item.type,
33
33
  pauseOnHover: true,
@@ -8,14 +8,18 @@ const jsx_runtime_1 = require("react/jsx-runtime");
8
8
  const react_datepicker_compat_1 = require("@fluentui/react-datepicker-compat");
9
9
  const locale_1 = require("@headless-adminapp/app/locale");
10
10
  const dayjs_1 = __importDefault(require("dayjs"));
11
+ const timezone_1 = __importDefault(require("dayjs/plugin/timezone"));
12
+ const utc_1 = __importDefault(require("dayjs/plugin/utc"));
11
13
  const AppStringContext_1 = require("../../App/AppStringContext");
14
+ dayjs_1.default.extend(utc_1.default);
15
+ dayjs_1.default.extend(timezone_1.default);
12
16
  function DateControl({ value, onChange, id, name, onBlur, onFocus, placeholder, disabled, readOnly, }) {
13
- const { dateFormats } = (0, locale_1.useLocale)();
17
+ const { dateFormats, timezone } = (0, locale_1.useLocale)();
14
18
  const { datePickerStrings } = (0, AppStringContext_1.useAppStrings)();
15
19
  return ((0, jsx_runtime_1.jsx)(react_datepicker_compat_1.DatePicker, { id: id, name: name, onFocus: () => onFocus === null || onFocus === void 0 ? void 0 : onFocus(), onBlur: () => onBlur === null || onBlur === void 0 ? void 0 : onBlur(), placeholder: placeholder, appearance: "filled-darker",
16
20
  // size="sm"
17
21
  // error={error}
18
22
  // maxDate={maxDate}
19
23
  // minDate={minDate}
20
- disabled: disabled, readOnly: readOnly, formatDate: (date) => (date ? (0, dayjs_1.default)(date).format(dateFormats.short) : ''), value: value ? new Date(value) : null, onSelectDate: (date) => onChange === null || onChange === void 0 ? void 0 : onChange(date ? date.toISOString() : null), strings: datePickerStrings }));
24
+ disabled: disabled, readOnly: readOnly, formatDate: (date) => date ? (0, dayjs_1.default)(date).tz(timezone).format(dateFormats.short) : '', value: value ? new Date(value) : null, onSelectDate: (date) => onChange === null || onChange === void 0 ? void 0 : onChange(date ? (0, dayjs_1.default)(date).tz(timezone).startOf('day').toISOString() : null), strings: datePickerStrings }));
21
25
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@headless-adminapp/fluent",
3
- "version": "0.0.17-alpha.24",
3
+ "version": "0.0.17-alpha.25",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "types": "index.d.ts",
@@ -44,5 +44,5 @@
44
44
  "react-hook-form": "7.52.2",
45
45
  "yup": "^1.4.0"
46
46
  },
47
- "gitHead": "3280eb0e29b7a026f0251771f564b33c123c9bec"
47
+ "gitHead": "0a42b982d6113067cd2f9739ec646d138c1a5274"
48
48
  }