You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@superset.apache.org by GitBox <gi...@apache.org> on 2021/01/06 06:53:23 UTC

[GitHub] [superset] zhaoyongjie commented on a change in pull request #12300: fix(explore): timepicker show human readable string in pill

zhaoyongjie commented on a change in pull request #12300:
URL: https://github.com/apache/superset/pull/12300#discussion_r552400625



##########
File path: superset-frontend/src/explore/components/controls/DateFilterControl/DateFilterControl.tsx
##########
@@ -183,15 +183,25 @@ export default function DateFilterControl(props: DateFilterLabelProps) {
   const [evalResponse, setEvalResponse] = useState<string>(value);
 
   useEffect(() => {
-    fetchTimeRange(value, endpoints).then(({ value, error }) => {
-      if (error) {
-        setEvalResponse(error || '');
-        setValidTimeRange(false);
-      } else {
-        setActualTimeRange(value || '');
-        setValidTimeRange(true);
-      }
-    });
+    const valueToLower = value.toLowerCase();
+    if (
+      valueToLower.startsWith('last') ||
+      valueToLower.startsWith('next') ||
+      valueToLower.startsWith('previous')
+    ) {
+      setActualTimeRange(value);

Review comment:
       good point, I will add t().




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

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org