parkhojeong commented on code in PR #66251:
URL: https://github.com/apache/airflow/pull/66251#discussion_r3219855454
##########
airflow-core/src/airflow/ui/src/components/DateTimeInput.tsx:
##########
@@ -54,16 +54,31 @@ export const DateTimeInput = forwardRef<HTMLInputElement,
Props>(({ onChange, va
debounceDelay,
);
+ const onPaste = (event: ClipboardEvent<HTMLInputElement>) => {
+ const pasted = event.clipboardData.getData("text");
+ const parsed = dayjs(pasted);
Review Comment:
I think there may be one timezone-related detail worth considering here.
Since paste is another way of entering a value into the same DateTimeInput,
it might be better for pasted values to follow the same timezone semantics as
manual input. The existing manual input path uses dayjs.tz(event.target.value,
selectedTimezone) before converting the value to UTC, so it seems to be based
on the selected Airflow UI timezone.
For pasted values with an explicit timezone or offset, such as
`2026-01-15T10:30:00Z` or `2026-01-15T10:30:00+09:00`, we may want to make sure
the displayed value is converted according to the selected Airflow UI timezone
rather than the browser’s local timezone.
A concrete example:
if the Airflow UI timezone is set to UTC, but the browser timezone is
Asia/Seoul, pasting `2026-01-15T10:30:00Z` may display `2026-01-15T19:30`.
Then onDateChange can interpret that as 19:30 in the selected Airflow UI
timezone, so the submitted value becomes `2026-01-15T19:30:00Z` instead of the
original `2026-01-15T10:30:00Z`.
<img width="2127" height="1180" alt="Image"
src="https://github.com/user-attachments/assets/24ee5dd7-a81d-4d30-bb79-05732ea3238b"
/>
---
Could you also add tests around this behavior? It would help clarify the
expected paste behavior and avoid regressions later.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]