@asteby/metacore-runtime-react 18.0.0 → 18.2.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.
@@ -47,8 +47,18 @@ export declare const DATE_CELL_TYPES: readonly ["date", "datetime", "timestamp",
47
47
  * - `date`: day only (`PPP`), no tooltip.
48
48
  * - `datetime`/`timestamp(tz)`: day + time (`Pp`) with a full-precision
49
49
  * tooltip (`PPpp`) — the 7Leguas pattern.
50
+ *
51
+ * When a `timeZone` (IANA, e.g. the org's `America/Mexico_City`) is provided,
52
+ * instants are rendered in that zone via the native `Intl.DateTimeFormat` so
53
+ * the displayed day/time never shifts with the viewer's browser timezone:
54
+ * - instant (datetime/timestamp(tz)): `dateStyle:'medium' timeStyle:'short'`
55
+ * in the org zone, with a `dateStyle:'long' timeStyle:'medium'` +
56
+ * `timeZoneName:'short'` tooltip.
57
+ * - `date` (pure calendar day): rendered pinned to UTC so it never rolls to
58
+ * the previous/next day, no tooltip.
59
+ * Without a `timeZone`, the exact date-fns behavior is preserved (back-compat).
50
60
  */
51
- export declare function formatDateCell(value: unknown, renderAs: string | undefined, locale: Locale): {
61
+ export declare function formatDateCell(value: unknown, renderAs: string | undefined, locale: Locale, timeZone?: string): {
52
62
  display: string;
53
63
  title?: string;
54
64
  } | null;
@@ -1 +1 @@
1
- {"version":3,"file":"dynamic-columns.d.ts","sourceRoot":"","sources":["../src/dynamic-columns.tsx"],"names":[],"mappings":"AAgBA,OAAO,EAAU,KAAK,MAAM,EAAE,MAAM,UAAU,CAAA;AAgC9C,OAAO,KAAK,EAAiB,gBAAgB,EAAE,MAAM,SAAS,CAAA;AAE9D,OAAO,KAAK,EAER,iBAAiB,EACpB,MAAM,wBAAwB,CAAA;AAE/B,qEAAqE;AACrE,MAAM,WAAW,qBAAqB;IAClC;;;;OAIG;IACH,WAAW,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,MAAM,CAAA;IACtC;;;;OAIG;IACH,UAA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AAM,KAAK,MAAM,CAAA;IACtC;;;;OAIG;IACH,UAAU,CAAC,EAAE,MAAM,CAAA;CACtB;AAgGD;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,0BAA0B,GAAI,QAAQ,GAAG,EAAE,KAAK,GAAG,KAAG,OAMlE,CAAA;AAqKD;;;;;;;GAOG;AACH,eAAO,MAAM,cAAc,GAAI,KAAK,IAAI,CAAC,gBAAgB,EAAE,KAAK,CAAC,KAAG,MAGnE,CAAA;AAED,6EAA6E;AAC7E,eAAO,MAAM,eAAe,2DAA4D,CAAA;AAExF;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,cAAc,CAC1B,KAAK,EAAE,OAAO,EACd,QAAQ,EAAE,MAAM,GAAG,SAAS,EAC5B,MAAM,EAAE,MAAM,EACd,QAAQ,CAAC,EAAE,MAAM,GAClB;IAAE,OAAO,EAAE,MAAM,CAAC;IAAC,KAAK,CAAC,EAAE,MAAM,CAAA;CAAE,GAAG,IAAI,CA6C5C;AAED;;;;;;;GAOG;AACH,eAAO,MAAM,oBAAoB,GAAI,KAAK,gBAAgB,EAAE,KAAK,GAAG,KAAG,MAWtE,CAAA;AAED;;;;;;GAMG;AACH,eAAO,MAAM,oBAAoB,GAAI,KAAK,gBAAgB,EAAE,KAAK,GAAG,KAAG,MAOtE,CAAA;AA0ED;;;;GAIG;AACH,wBAAgB,4BAA4B,CACxC,OAAO,GAAE,qBAA0B,GACpC,iBAAiB,CAumBnB;AAED;;;;GAIG;AACH,eAAO,MAAM,wBAAwB,EAAE,iBACL,CAAA"}
@@ -219,14 +219,57 @@ export const DATE_CELL_TYPES = ['date', 'datetime', 'timestamp', 'timestamptz'];
219
219
  * - `date`: day only (`PPP`), no tooltip.
220
220
  * - `datetime`/`timestamp(tz)`: day + time (`Pp`) with a full-precision
221
221
  * tooltip (`PPpp`) — the 7Leguas pattern.
222
+ *
223
+ * When a `timeZone` (IANA, e.g. the org's `America/Mexico_City`) is provided,
224
+ * instants are rendered in that zone via the native `Intl.DateTimeFormat` so
225
+ * the displayed day/time never shifts with the viewer's browser timezone:
226
+ * - instant (datetime/timestamp(tz)): `dateStyle:'medium' timeStyle:'short'`
227
+ * in the org zone, with a `dateStyle:'long' timeStyle:'medium'` +
228
+ * `timeZoneName:'short'` tooltip.
229
+ * - `date` (pure calendar day): rendered pinned to UTC so it never rolls to
230
+ * the previous/next day, no tooltip.
231
+ * Without a `timeZone`, the exact date-fns behavior is preserved (back-compat).
222
232
  */
223
- export function formatDateCell(value, renderAs, locale) {
233
+ export function formatDateCell(value, renderAs, locale, timeZone) {
224
234
  if (value === null || value === undefined || value === '')
225
235
  return null;
226
236
  const date = new Date(value);
227
237
  if (isNaN(date.getTime()) || date.getFullYear() <= 1)
228
238
  return null;
229
239
  const withTime = renderAs !== 'date';
240
+ if (timeZone) {
241
+ // `locale.code` is the BCP-47 tag date-fns ships (e.g. 'es', 'en-US').
242
+ const localeTag = locale?.code || undefined;
243
+ if (withTime) {
244
+ return {
245
+ display: new Intl.DateTimeFormat(localeTag, {
246
+ timeZone,
247
+ dateStyle: 'medium',
248
+ timeStyle: 'short',
249
+ }).format(date),
250
+ // `dateStyle`/`timeStyle` can't be combined with explicit
251
+ // component options like `timeZoneName`, so spell the tooltip
252
+ // out: long date + seconds + the zone abbreviation.
253
+ title: new Intl.DateTimeFormat(localeTag, {
254
+ timeZone,
255
+ year: 'numeric',
256
+ month: 'long',
257
+ day: 'numeric',
258
+ hour: '2-digit',
259
+ minute: '2-digit',
260
+ second: '2-digit',
261
+ timeZoneName: 'short',
262
+ }).format(date),
263
+ };
264
+ }
265
+ // Pure calendar date: pin to UTC so it never shifts across zones.
266
+ return {
267
+ display: new Intl.DateTimeFormat(localeTag, {
268
+ timeZone: 'UTC',
269
+ dateStyle: 'long',
270
+ }).format(date),
271
+ };
272
+ }
230
273
  if (withTime) {
231
274
  return {
232
275
  display: format(date, 'Pp', { locale }),
@@ -308,7 +351,7 @@ const AvatarCell = ({ name, desc, avatarSrc, getImageUrl }) => (_jsxs("div", { c
308
351
  export function makeDefaultGetDynamicColumns(helpers = {}) {
309
352
  const getImageUrl = helpers.getImageUrl ?? defaultGetImageUrl;
310
353
  const apiBaseUrl = helpers.apiBaseUrl ?? '';
311
- return function defaultGetDynamicColumns(metadata, onAction, t, currentLanguage, filterConfigs) {
354
+ return function defaultGetDynamicColumns(metadata, onAction, t, currentLanguage, filterConfigs, timeZone) {
312
355
  const dateLocale = currentLanguage === 'en' ? enUS : es;
313
356
  const columns = [
314
357
  {
@@ -426,7 +469,7 @@ export function makeDefaultGetDynamicColumns(helpers = {}) {
426
469
  case 'datetime':
427
470
  case 'timestamp':
428
471
  case 'timestamptz': {
429
- const formatted = formatDateCell(value, renderAs, dateLocale);
472
+ const formatted = formatDateCell(value, renderAs, dateLocale, timeZone);
430
473
  if (!formatted)
431
474
  return _jsx("span", { className: "text-muted-foreground", children: "-" });
432
475
  return (_jsxs("div", { className: "flex items-center gap-1.5 text-muted-foreground", title: formatted.title, children: [_jsx(icons.Calendar, { className: "h-3.5 w-3.5 opacity-70" }), _jsx("span", { className: "text-sm font-medium", children: formatted.display })] }));
@@ -1,4 +1,25 @@
1
+ import { type ResolvedOption } from './use-options-resolver';
1
2
  import type { ActionFieldDef } from './types';
3
+ /**
4
+ * Small square thumbnail for an option's `image`. Falls back to a neutral
5
+ * placeholder icon when the option has no image so rows/triggers stay aligned.
6
+ * `size` is in pixels (kept small — 20–24px — so the picker reads as a list,
7
+ * not a gallery). Inline style for the box dimensions: arbitrary Tailwind
8
+ * classes from a federated addon don't always survive the host's class scan.
9
+ */
10
+ export declare function OptionThumb({ image, size }: {
11
+ image?: string | null;
12
+ size?: number;
13
+ }): import("react").JSX.Element;
14
+ /**
15
+ * Leading visual for an option: a photo thumbnail (FK relations with an image),
16
+ * else a declared icon, else a color dot (enum/status options with a color).
17
+ * Returns null when the option carries none, so plain text options stay plain.
18
+ */
19
+ export declare function OptionLead({ option, size, }: {
20
+ option?: Pick<ResolvedOption, 'image' | 'color' | 'icon'> | null;
21
+ size?: number;
22
+ }): import("react").JSX.Element | null;
2
23
  export interface DynamicSelectFieldProps {
3
24
  field: ActionFieldDef;
4
25
  value: any;
@@ -1 +1 @@
1
- {"version":3,"file":"dynamic-select-field.d.ts","sourceRoot":"","sources":["../src/dynamic-select-field.tsx"],"names":[],"mappings":"AAyCA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,SAAS,CAAA;AA+F7C,MAAM,WAAW,uBAAuB;IACpC,KAAK,EAAE,cAAc,CAAA;IACrB,KAAK,EAAE,GAAG,CAAA;IACV,QAAQ,EAAE,CAAC,CAAC,EAAE,GAAG,KAAK,IAAI,CAAA;CAC7B;AAED,wBAAgB,kBAAkB,CAAC,EAAE,KAAK,EAAE,KAAK,EAAE,QAAQ,EAAE,EAAE,uBAAuB,+BA0KrF;AAED,eAAe,kBAAkB,CAAA"}
1
+ {"version":3,"file":"dynamic-select-field.d.ts","sourceRoot":"","sources":["../src/dynamic-select-field.tsx"],"names":[],"mappings":"AAuCA,OAAO,EAAsB,KAAK,cAAc,EAAE,MAAM,wBAAwB,CAAA;AAEhF,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,SAAS,CAAA;AAE7C;;;;;;GAMG;AACH,wBAAgB,WAAW,CAAC,EAAE,KAAK,EAAE,IAAS,EAAE,EAAE;IAAE,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAAC,IAAI,CAAC,EAAE,MAAM,CAAA;CAAE,+BA4BzF;AAED;;;;GAIG;AACH,wBAAgB,UAAU,CAAC,EACvB,MAAM,EACN,IAAS,GACZ,EAAE;IACC,MAAM,CAAC,EAAE,IAAI,CAAC,cAAc,EAAE,OAAO,GAAG,OAAO,GAAG,MAAM,CAAC,GAAG,IAAI,CAAA;IAChE,IAAI,CAAC,EAAE,MAAM,CAAA;CAChB,sCAwBA;AAqBD,MAAM,WAAW,uBAAuB;IACpC,KAAK,EAAE,cAAc,CAAA;IACrB,KAAK,EAAE,GAAG,CAAA;IACV,QAAQ,EAAE,CAAC,CAAC,EAAE,GAAG,KAAK,IAAI,CAAA;CAC7B;AAED,wBAAgB,kBAAkB,CAAC,EAAE,KAAK,EAAE,KAAK,EAAE,QAAQ,EAAE,EAAE,uBAAuB,+BA0KrF;AAED,eAAe,kBAAkB,CAAA"}
@@ -36,7 +36,7 @@ import { getFieldRef } from './dynamic-form-schema';
36
36
  * not a gallery). Inline style for the box dimensions: arbitrary Tailwind
37
37
  * classes from a federated addon don't always survive the host's class scan.
38
38
  */
39
- function OptionThumb({ image, size = 20 }) {
39
+ export function OptionThumb({ image, size = 20 }) {
40
40
  const box = { width: size, height: size };
41
41
  if (!image) {
42
42
  return (_jsx("span", { className: "text-muted-foreground bg-muted flex shrink-0 items-center justify-center rounded-sm", style: box, "aria-hidden": true, children: _jsx(ImageIcon, { className: "size-3 opacity-60" }) }));
@@ -53,7 +53,7 @@ function OptionThumb({ image, size = 20 }) {
53
53
  * else a declared icon, else a color dot (enum/status options with a color).
54
54
  * Returns null when the option carries none, so plain text options stay plain.
55
55
  */
56
- function OptionLead({ option, size = 20, }) {
56
+ export function OptionLead({ option, size = 20, }) {
57
57
  if (!option)
58
58
  return null;
59
59
  if (option.image)
@@ -16,7 +16,14 @@ interface DynamicTableProps {
16
16
  * Optional — a sensible default maps each column to { accessorKey, header }.
17
17
  */
18
18
  getDynamicColumns?: GetDynamicColumns;
19
+ /**
20
+ * IANA timezone (e.g. the org's `America/Mexico_City`) used to render
21
+ * datetime/timestamp cells. When provided, instants are displayed in this
22
+ * zone instead of the viewer's browser zone, so the day/time never shifts.
23
+ * Optional — omitting it preserves the legacy browser-local formatting.
24
+ */
25
+ timeZone?: string;
19
26
  }
20
- export declare function DynamicTable({ model, endpoint, enableUrlSync, hiddenColumns, onAction, refreshTrigger, defaultFilters, extraColumns, getDynamicColumns, }: DynamicTableProps): import("react").JSX.Element;
27
+ export declare function DynamicTable({ model, endpoint, enableUrlSync, hiddenColumns, onAction, refreshTrigger, defaultFilters, extraColumns, getDynamicColumns, timeZone, }: DynamicTableProps): import("react").JSX.Element;
21
28
  export {};
22
29
  //# sourceMappingURL=dynamic-table.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"dynamic-table.d.ts","sourceRoot":"","sources":["../src/dynamic-table.tsx"],"names":[],"mappings":"AAiBA,OAAO,EAKH,KAAK,SAAS,EAajB,MAAM,uBAAuB,CAAA;AA+B9B,OAAO,KAAK,EAAsB,iBAAiB,EAAE,MAAM,wBAAwB,CAAA;AAUnF,UAAU,iBAAiB;IACvB,KAAK,EAAE,MAAM,CAAA;IACb,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,aAAa,CAAC,EAAE,OAAO,CAAA;IACvB,aAAa,CAAC,EAAE,MAAM,EAAE,CAAA;IACxB,QAAQ,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,GAAG,EAAE,GAAG,KAAK,IAAI,CAAA;IAC7C,cAAc,CAAC,EAAE,GAAG,CAAA;IACpB,cAAc,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAA;IACpC,YAAY,CAAC,EAAE,SAAS,CAAC,GAAG,CAAC,EAAE,CAAA;IAC/B;;;;;OAKG;IACH,iBAAiB,CAAC,EAAE,iBAAiB,CAAA;CACxC;AAED,wBAAgB,YAAY,CAAC,EACzB,KAAK,EACL,QAAQ,EACR,aAAoB,EACpB,aAAkB,EAClB,QAAQ,EACR,cAAc,EACd,cAAc,EACd,YAAiB,EACjB,iBAA4C,GAC/C,EAAE,iBAAiB,+BAgyBnB"}
1
+ {"version":3,"file":"dynamic-table.d.ts","sourceRoot":"","sources":["../src/dynamic-table.tsx"],"names":[],"mappings":"AAiBA,OAAO,EAKH,KAAK,SAAS,EAajB,MAAM,uBAAuB,CAAA;AA+B9B,OAAO,KAAK,EAAsB,iBAAiB,EAAE,MAAM,wBAAwB,CAAA;AAUnF,UAAU,iBAAiB;IACvB,KAAK,EAAE,MAAM,CAAA;IACb,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,aAAa,CAAC,EAAE,OAAO,CAAA;IACvB,aAAa,CAAC,EAAE,MAAM,EAAE,CAAA;IACxB,QAAQ,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,GAAG,EAAE,GAAG,KAAK,IAAI,CAAA;IAC7C,cAAc,CAAC,EAAE,GAAG,CAAA;IACpB,cAAc,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAA;IACpC,YAAY,CAAC,EAAE,SAAS,CAAC,GAAG,CAAC,EAAE,CAAA;IAC/B;;;;;OAKG;IACH,iBAAiB,CAAC,EAAE,iBAAiB,CAAA;IACrC;;;;;OAKG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAA;CACpB;AAED,wBAAgB,YAAY,CAAC,EACzB,KAAK,EACL,QAAQ,EACR,aAAoB,EACpB,aAAkB,EAClB,QAAQ,EACR,cAAc,EACd,cAAc,EACd,YAAiB,EACjB,iBAA4C,EAC5C,QAAQ,GACX,EAAE,iBAAiB,+BAgyBnB"}
@@ -31,7 +31,7 @@ import { getSearchableColumnKeys } from './column-visibility';
31
31
  import { DynamicRecordDialog } from './dialogs/dynamic-record';
32
32
  import { ExportDialog } from './dialogs/export';
33
33
  import { ImportDialog } from './dialogs/import';
34
- export function DynamicTable({ model, endpoint, enableUrlSync = true, hiddenColumns = [], onAction, refreshTrigger, defaultFilters, extraColumns = [], getDynamicColumns = defaultGetDynamicColumns, }) {
34
+ export function DynamicTable({ model, endpoint, enableUrlSync = true, hiddenColumns = [], onAction, refreshTrigger, defaultFilters, extraColumns = [], getDynamicColumns = defaultGetDynamicColumns, timeZone, }) {
35
35
  const { t, i18n } = useTranslation();
36
36
  const api = useApi();
37
37
  const currentBranch = useCurrentBranch();
@@ -555,12 +555,12 @@ export function DynamicTable({ model, endpoint, enableUrlSync = true, hiddenColu
555
555
  const rowMetadata = metadata.actions?.some((a) => a.placement === 'table' || a.placement === 'create')
556
556
  ? { ...metadata, actions: metadata.actions.filter((a) => !a.placement || a.placement === 'row') }
557
557
  : metadata;
558
- const baseColumns = getDynamicColumns(rowMetadata, handleInternalAction, t, i18n.language, columnFilterConfigs);
558
+ const baseColumns = getDynamicColumns(rowMetadata, handleInternalAction, t, i18n.language, columnFilterConfigs, timeZone);
559
559
  const filteredBase = baseColumns.filter((col) => !hiddenColumns.includes(col.id));
560
560
  const actionsCol = filteredBase.find((c) => c.id === 'actions');
561
561
  const otherCols = filteredBase.filter((c) => c.id !== 'actions');
562
562
  return [...otherCols, ...extraColumns, ...(actionsCol ? [actionsCol] : [])];
563
- }, [metadata, handleInternalAction, hiddenColumns, extraColumns, t, i18n.language, columnFilterConfigs, getDynamicColumns]);
563
+ }, [metadata, handleInternalAction, hiddenColumns, extraColumns, t, i18n.language, columnFilterConfigs, getDynamicColumns, timeZone]);
564
564
  const filters = useMemo(() => [], []);
565
565
  const table = useReactTable({
566
566
  data,
package/dist/index.d.ts CHANGED
@@ -19,7 +19,8 @@ export type { ColumnFilterConfig, FilterOption as DynamicColumnFilterOption, Get
19
19
  export { defaultGetDynamicColumns, makeDefaultGetDynamicColumns, relationKeyFor, resolveRelationLabel, type DynamicColumnsHelpers, } from './dynamic-columns';
20
20
  export { humanizeToken } from './dynamic-columns-helpers';
21
21
  export { NIL_UUID, isNilUuid, normalizeNilUuid } from './nil-uuid';
22
- export { DynamicRecordDialog } from './dialogs/dynamic-record';
22
+ export { DynamicRecordDialog, ViewValue } from './dialogs/dynamic-record';
23
+ export type { DynamicRecordDialogProps, FieldDef, FieldOption, GetImageUrl } from './dialogs/dynamic-record';
23
24
  export { CreateRecordDialog } from './dialogs/create-record-dialog';
24
25
  export { ViewRecordDialog } from './dialogs/view-record-dialog';
25
26
  export type { ModelKey, ModelSchema, CreateResult, RecordDialogProps, CreateRecordDialogProps, ViewRecordDialogProps, } from './dialogs/types';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":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B,GAC3B,MAAM,4BAA4B,CAAA;AACnC,OAAO,EACH,sBAAsB,EACtB,uBAAuB,GAC1B,MAAM,qBAAqB,CAAA;AAC5B,OAAO,EACH,kBAAkB,EAClB,aAAa,EACb,KAAK,cAAc,EACnB,KAAK,WAAW,EAChB,KAAK,sBAAsB,EAC3B,KAAK,wBAAwB,GAChC,MAAM,wBAAwB,CAAA;AAC/B,OAAO,EACH,kBAAkB,EAClB,kBAAkB,EAClB,qBAAqB,EACrB,KAAK,eAAe,GACvB,MAAM,yBAAyB,CAAA;AAChC,OAAO,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAA"}
package/dist/index.js CHANGED
@@ -23,7 +23,7 @@ export * from './dynamic-icon';
23
23
  export { defaultGetDynamicColumns, makeDefaultGetDynamicColumns, relationKeyFor, resolveRelationLabel, } from './dynamic-columns';
24
24
  export { humanizeToken } from './dynamic-columns-helpers';
25
25
  export { NIL_UUID, isNilUuid, normalizeNilUuid } from './nil-uuid';
26
- export { DynamicRecordDialog } from './dialogs/dynamic-record';
26
+ export { DynamicRecordDialog, ViewValue } from './dialogs/dynamic-record';
27
27
  export { CreateRecordDialog } from './dialogs/create-record-dialog';
28
28
  export { ViewRecordDialog } from './dialogs/view-record-dialog';
29
29
  export { ExportDialog } from './dialogs/export';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@asteby/metacore-runtime-react",
3
- "version": "18.0.0",
3
+ "version": "18.2.0",
4
4
  "description": "React runtime for metacore hosts — renders addon contributions dynamically",
5
5
  "repository": {
6
6
  "type": "git",
@@ -49,4 +49,31 @@ describe('formatDateCell', () => {
49
49
  it('returns null for an unparseable value', () => {
50
50
  expect(formatDateCell('not-a-date', 'datetime', enUS)).toBeNull()
51
51
  })
52
+
53
+ describe('timeZone-aware (org IANA zone)', () => {
54
+ // 2026-06-07T00:00:00Z is the previous day, 19:00, in America/Mexico_City
55
+ // (UTC-5). A browser-local formatter in a UTC-2 zone would day-shift it;
56
+ // pinning to the org zone must show June 6.
57
+ const midnightUtc = '2026-06-07T00:00:00Z'
58
+
59
+ it('renders an instant in the provided zone, not the browser zone', () => {
60
+ const out = formatDateCell(midnightUtc, 'datetime', enUS, 'America/Mexico_City')
61
+ expect(out).not.toBeNull()
62
+ // Mexico City is UTC-5/-6 → the instant falls on June 6, 19:00.
63
+ expect(out!.display).toMatch(/Jun 6, 2026/)
64
+ expect(out!.display).toMatch(/\d{1,2}:\d{2}/)
65
+ // Tooltip carries full precision + the zone abbreviation.
66
+ expect(out!.title).toBeDefined()
67
+ expect(out!.title).toMatch(/2026/)
68
+ })
69
+
70
+ it('renders a pure `date` pinned to UTC so it never shifts', () => {
71
+ const out = formatDateCell(midnightUtc, 'date', enUS, 'America/Mexico_City')
72
+ expect(out).not.toBeNull()
73
+ // UTC-pinned: stays on June 7 regardless of zone, no time, no tooltip.
74
+ expect(out!.display).toMatch(/June 7, 2026/)
75
+ expect(out!.display).not.toMatch(/\d{1,2}:\d{2}/)
76
+ expect(out!.title).toBeUndefined()
77
+ })
78
+ })
52
79
  })