Arunodoy18 opened a new pull request, #62024:
URL: https://github.com/apache/airflow/pull/62024

   ### 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?
   
   - [X] Yes (ChatGPT, GitHub Copilot)
   
   Generated-by: ChatGPT and GitHub Copilot following Airflow Gen-AI 
contribution guidelines
   


-- 
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]

Reply via email to