From 349342efb795099161ceba1fd1a9793e9e24e638 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=BA=8C=E4=B8=AB=E8=AE=B2=E6=A2=B5?= Date: Sun, 30 Aug 2026 09:58:34 +0800 Subject: [PATCH] feat(grid): add 12-hour datetime format and timezone aliases --- apps/desktop/src/components/grid/DataGrid.vue | 6 ++++-- apps/desktop/src/lib/dataGrid/columnFormatter.ts | 11 +++++++++++ 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/apps/desktop/src/components/grid/DataGrid.vue b/apps/desktop/src/components/grid/DataGrid.vue index 3d3eac0ade..43cb8263e1 100644 --- a/apps/desktop/src/components/grid/DataGrid.vue +++ b/apps/desktop/src/components/grid/DataGrid.vue @@ -174,6 +174,8 @@ import { applyColumnFormatter, buildColumnFormatterKey, defaultIoTDBTimestampFormatter, + DataGridDateTimePatterns, + displayTimeZoneOption, formatIoTDBTimestampEditorValue, getSupportedTimeZoneOptions, iotdbTimestampFractionDigits, @@ -184,7 +186,6 @@ import { type ColumnFormatterConfig, type DateTimeFormatterUnit, type ForeignKeyDisplayFilterConfig, - DateTimePatterns, } from "@/lib/dataGrid/columnFormatter"; import { temporalCellEditorConfig, type TemporalCellEditorConfig } from "@/lib/dataGrid/dataGridTemporalEditor"; import { BOOLEAN_CELL_EDITOR_VALUES, booleanCellEditorValue, isBooleanCellValue, isBooleanColumnType, isPointInBooleanCheckbox, nextBooleanCellValue, normalizeBooleanCellValue, parseBooleanCellEditorValue } from "@/lib/dataGrid/dataGridBooleanColumn"; @@ -12983,7 +12984,7 @@ function openGridSnapshot() { string[]; } +const TIME_ZONE_DISPLAY_ALIASES: Record = { + "Asia/Calcutta": "Asia/Kolkata", +}; + +export function displayTimeZoneOption(timeZone: string): string { + return TIME_ZONE_DISPLAY_ALIASES[timeZone] ?? timeZone; +} + export function getSupportedTimeZoneOptions(intl: IntlTimeZoneSupport, fallbackTimeZone = "UTC"): string[] { try { const timeZones = intl.supportedValuesOf?.("timeZone");