Skip to content

Fix UI logical date timezone mismatch on DAG trigger#62024

Open
Arunodoy18 wants to merge 1 commit intoapache:mainfrom
Arunodoy18:fix/ui-logical-date-timezone-61982
Open

Fix UI logical date timezone mismatch on DAG trigger#62024
Arunodoy18 wants to merge 1 commit intoapache:mainfrom
Arunodoy18:fix/ui-logical-date-timezone-61982

Conversation

@Arunodoy18
Copy link
Contributor

Problem

When triggering a DAG from the UI while the UI timezone is set to a non-UTC timezone, the logical date received by the backend does not match the logical date selected in the UI.

This results in inconsistent DAG run scheduling and incorrect logical date assignment.


Root Cause

Two issues were identified in the frontend:

  1. TriggerDAGForm initialized logicalDate using a naive datetime format (YYYY-MM-DD HH:mm:ss).
    This produced timezone-ambiguous parsing behaviour when interpreted by browser Date() APIs.

  2. DateTimeInput used a space separator instead of the T separator required by datetime-local inputs, causing inconsistent browser parsing behaviour.


Solution

  • Use dayjs().toISOString() to ensure logical date is serialized as an unambiguous UTC datetime.
  • Use YYYY-MM-DDTHH:mm:ss format for datetime-local display to comply with browser standards.
  • Ensure frontend → API → backend logical date consistency.

Tests

Added tests to verify timezone correctness:

  • Frontend logical date serialization tests
  • Backend logical date parsing validation tests
  • End-to-end logical date consistency validation

Impact

  • Ensures consistent logical date handling across UI and backend.
  • Prevents timezone-related scheduling mismatches when triggering DAGs.

closes: #61982

Was generative AI tooling used to co-author this PR?
  • Yes (ChatGPT, GitHub Copilot)

Generated-by: ChatGPT and GitHub Copilot following Airflow Gen-AI contribution guidelines

When triggering a DAG with the UI timezone set to non-UTC, the logical date received by the backend did not match the date selected in the UI.

Root causes:

- TriggerDAGForm initialized logicalDate with a naive format string (YYYY-MM-DD HH:mm:ss) which was ambiguous when parsed by Date()

- DateTimeInput used space separator instead of 'T' required by datetime-local inputs

Fix:

- Use dayjs().toISOString() for unambiguous UTC datetime

- Use YYYY-MM-DDTHH:mm:ss format for datetime-local display

- Add frontend and backend tests for timezone correctness

Fixes apache#61982
@boring-cyborg boring-cyborg bot added area:API Airflow's REST/HTTP API area:UI Related to UI/UX. For Frontend Developers. labels Feb 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:API Airflow's REST/HTTP API area:UI Related to UI/UX. For Frontend Developers.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Selected dag trigger logical date is different from the logical date that is sent to the backend

1 participant