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/19 14:08:54 UTC

[GitHub] [superset] zhaoyongjie edited a comment on pull request #12552: fix(explore): deprecated x periods pattern in new time picker value

zhaoyongjie edited a comment on pull request #12552:
URL: https://github.com/apache/superset/pull/12552#issuecomment-762859397


   > thanks for the fix! @zhaoyongjie, all changes LGTM!
   > 
   > Question: when i type '3' in the box, the modal populates 2021-01-03, with 3 as date.
   > vs. when i type in '40', modal takes it as year... what's the logic behind? should we consider both as unclear input and prompt users to be more specific before generating a time range as well?
   > 
   > <img alt="Screen Shot 2021-01-17 at 6 14 48 PM" width="933" src="https://user-images.githubusercontent.com/67837651/104868888-0e95e800-58f1-11eb-8e9e-a6a53e6a7bd0.png">
   
   Hi @junlincc 
   
   This is a good point. This behaviour looks like this: when the input string is less than 31, it will be derived as the day of current month, when it is greater than 31 it will be derived as the year. This is `parsedatetime.Calendar()` behavior.
   https://github.com/apache/superset/blob/84266bfa9ed1acd532eea611ec322a1eaa9480fa/superset/utils/date_parser.py#L78-L79
   
   If the datetime derived(parse) is to be improved. It is need to specify a fixed format for date parse.
   
   
   


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