mistercrunch commented on code in PR #31019:
URL: https://github.com/apache/superset/pull/31019#discussion_r1915715862


##########
superset-frontend/src/components/ListView/Filters/DateRange.tsx:
##########
@@ -51,40 +54,47 @@ function DateRangeFilter(
   ref: RefObject<FilterHandler>,
 ) {
   const [value, setValue] = useState<ValueState | null>(initialValue ?? null);
-  const momentValue = useMemo((): [Moment, Moment] | null => {
+  const dayjsValue = useMemo((): [Dayjs, Dayjs] | null => {
     if (!value || (Array.isArray(value) && !value.length)) return null;
-    return [moment(value[0]), moment(value[1])];
+    return [extendedDayjs(value[0]), extendedDayjs(value[1])];
   }, [value]);
 
+  const locale = useLocale();
+
   useImperativeHandle(ref, () => ({
     clearFilter: () => {
       setValue(null);
       onSubmit([]);
     },
   }));
 
+  if (locale === null) {
+    return <Loading position="inline-centered" />;
+  }
   return (
-    <RangeFilterContainer>
-      <FormLabel>{Header}</FormLabel>
-      <RangePicker
-        placeholder={[t('Start date'), t('End date')]}
-        showTime
-        value={momentValue}
-        onChange={momentRange => {
-          if (!momentRange) {
-            setValue(null);
-            onSubmit([]);
-            return;
-          }
-          const changeValue = [
-            momentRange[0]?.valueOf() ?? 0,
-            momentRange[1]?.valueOf() ?? 0,
-          ] as ValueState;
-          setValue(changeValue);
-          onSubmit(changeValue);
-        }}
-      />
-    </RangeFilterContainer>
+    <AntdThemeProvider locale={locale}>

Review Comment:
   Noticed this while rebasing my large theming PR, but we won't want to 
re-inject the AntdThemeProvider in multiple places. My PR will clean this up 
and load it once and only once 



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


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to