zhaoyongjie opened a new pull request, #26022: URL: https://github.com/apache/superset/pull/26022
### SUMMARY The Time Filter currently supports DSL for defining arbitrary time expressions, such as `date_trunc`, `date_add`, `holidays`, and more. However, users without a technical background often find it challenging to use. This pull request proposes the introduction of a new feature in the Time Filter called 'Shortcut.' In this feature, we can easily define custom time ranges in `config.py`, and the arbitrary time expressions will dynamically appear in it. The pre-defined shortcuts is above, of course, we should change it if you want ``` TIME_FILTER_SHORTCUTS = [ ["Current week", "DATETRUNC(DATETIME('today'), WEEK) : today"], ["Current month(MTD)", "DATETRUNC(DATETIME('today'), MONTH) : today"], ["Current year(YTD)", "DATETRUNC(DATETIME('today'), YEAR) : today"], ] ``` ### BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF <!--- Skip this if not applicable --> ## Shortcuts in Frame <img width="1341" alt="image" src="https://github.com/apache/superset/assets/2016594/1a6c6429-e075-45c3-8477-58bad86b42d1"> ## Shortcuts <img width="1221" alt="image" src="https://github.com/apache/superset/assets/2016594/d2bf571d-464f-42ae-8b67-0bc3b8cb2104"> ### TESTING INSTRUCTIONS <!--- Required! What steps can be taken to manually verify the changes? --> CI and manually ### ADDITIONAL INFORMATION <!--- Check any relevant boxes with "x" --> <!--- HINT: Include "Fixes #nnn" if you are fixing an existing issue --> - [ ] Has associated issue: - [ ] Required feature flags: - [x] Changes UI - [ ] Includes DB Migration (follow approval process in [SIP-59](https://github.com/apache/superset/issues/13351)) - [ ] Migration is atomic, supports rollback & is backwards-compatible - [ ] Confirm DB migration upgrade and downgrade tested - [ ] Runtime estimates and downtime expectations provided - [X] Introduces new feature or API - [ ] Removes existing feature or API -- 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: notifications-unsubscr...@superset.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: notifications-unsubscr...@superset.apache.org For additional commands, e-mail: notifications-h...@superset.apache.org