From 7dd4db52df868a8b7d4fdb20c21814da7ebd4625 Mon Sep 17 00:00:00 2001 From: zhaoying Date: Fri, 26 Dec 2025 16:28:02 +0800 Subject: [PATCH] fix(web): time tool add time zone --- web/src/views/ToolManagement/components/TimeToolModal.tsx | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/web/src/views/ToolManagement/components/TimeToolModal.tsx b/web/src/views/ToolManagement/components/TimeToolModal.tsx index 81cb343c..75d8b148 100644 --- a/web/src/views/ToolManagement/components/TimeToolModal.tsx +++ b/web/src/views/ToolManagement/components/TimeToolModal.tsx @@ -5,6 +5,8 @@ import { useTranslation } from 'react-i18next'; import type { ToolItem, TimeToolModalRef } from '../types' import RbModal from '@/components/RbModal'; import { execute } from '@/api/tools'; +import { useI18n } from '@/store/locale' + const FormItem = Form.Item; const tabKeys = ['currentTime', 'timestampConversion', 'timeFormat'] @@ -24,6 +26,7 @@ interface CurrentTimeObj { } const TimeToolModal = forwardRef((_props, ref) => { const { t } = useTranslation(); + const { timeZone } = useI18n() const [visible, setVisible] = useState(false); const [form] = Form.useForm<{ timestamp: string; formatType: string; }>(); const [data, setData] = useState({} as ToolItem) @@ -81,6 +84,7 @@ const TimeToolModal = forwardRef((_props, ref) => { "parameters": { "operation": "timestamp_to_datetime", "input_value": timestamp, + "to_timezone": timeZone } }) .then(res => { @@ -95,7 +99,7 @@ const TimeToolModal = forwardRef((_props, ref) => { parameters: { operation: 'now', output_format: values.formatType, - to_timezone: 'UTC' + to_timezone: timeZone } }).then(res => { const response = res as { data: CurrentTimeObj }