pierrejeambrun commented on code in PR #54593:
URL: https://github.com/apache/airflow/pull/54593#discussion_r2285801970


##########
airflow-core/src/airflow/ui/src/components/DateTimeInput.tsx:
##########
@@ -17,42 +17,26 @@
  * under the License.
  */
 import { Input, type InputProps } from "@chakra-ui/react";
-import dayjs from "dayjs";
-import tz from "dayjs/plugin/timezone";
 import { forwardRef } from "react";
 
-import { useTimezone } from "src/context/timezone";
-
-dayjs.extend(tz);
-
 type Props = {
   readonly value: string;
 } & InputProps;
 
-export const DateTimeInput = forwardRef<HTMLInputElement, Props>(({ onChange, 
value, ...rest }, ref) => {
-  const { selectedTimezone } = useTimezone();
-
-  // Make the value timezone-aware
-  const date = 
dayjs(value).tz(selectedTimezone).format("YYYY-MM-DDTHH:mm:ss.SSS");
-
-  return (
-    <Input
-      onChange={(event) =>
-        onChange?.({
-          ...event,
-          target: {
-            ...event.target,
-            // Return a timezone-aware ISO string
-            value: dayjs(event.target.value).isValid()
-              ? dayjs(event.target.value).tz(selectedTimezone, 
true).toISOString()
-              : "",
-          },
-        })
-      }
-      ref={ref}
-      type="datetime-local"
-      value={date}
-      {...rest}
-    />
-  );
-});
+export const DateTimeInput = forwardRef<HTMLInputElement, Props>(({ onChange, 
value, ...rest }, ref) => (

Review Comment:
   For intance EventLogs filtering:
   <img width="1895" height="861" alt="Screenshot 2025-08-19 at 18 43 10" 
src="https://github.com/user-attachments/assets/8486ac63-8f82-418d-98e6-43a33f052cdc";
 />
   



##########
airflow-core/src/airflow/ui/src/components/DateTimeInput.tsx:
##########
@@ -17,42 +17,26 @@
  * under the License.
  */
 import { Input, type InputProps } from "@chakra-ui/react";
-import dayjs from "dayjs";
-import tz from "dayjs/plugin/timezone";
 import { forwardRef } from "react";
 
-import { useTimezone } from "src/context/timezone";
-
-dayjs.extend(tz);
-
 type Props = {
   readonly value: string;
 } & InputProps;
 
-export const DateTimeInput = forwardRef<HTMLInputElement, Props>(({ onChange, 
value, ...rest }, ref) => {
-  const { selectedTimezone } = useTimezone();
-
-  // Make the value timezone-aware
-  const date = 
dayjs(value).tz(selectedTimezone).format("YYYY-MM-DDTHH:mm:ss.SSS");
-
-  return (
-    <Input
-      onChange={(event) =>
-        onChange?.({
-          ...event,
-          target: {
-            ...event.target,
-            // Return a timezone-aware ISO string
-            value: dayjs(event.target.value).isValid()
-              ? dayjs(event.target.value).tz(selectedTimezone, 
true).toISOString()
-              : "",
-          },
-        })
-      }
-      ref={ref}
-      type="datetime-local"
-      value={date}
-      {...rest}
-    />
-  );
-});
+export const DateTimeInput = forwardRef<HTMLInputElement, Props>(({ onChange, 
value, ...rest }, ref) => (

Review Comment:
   `DateTimeInput` is used at multiple places, we also just merged 
`EventsFilters`, `XComFilters`.
   
   We might need to also make the datetime tz aware there before feeding it to 
the `DateTimeInput` component, but that would duplicate the conversion, maybe 
there's a way to achieve that without this duplication.



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