diff --git a/superset-frontend/src/explore/components/controls/DateFilterControl/frame/AdvancedFrame.tsx b/superset-frontend/src/explore/components/controls/DateFilterControl/frame/AdvancedFrame.tsx index 8598b2d7bc..f5ae9446c2 100644 --- a/superset-frontend/src/explore/components/controls/DateFilterControl/frame/AdvancedFrame.tsx +++ b/superset-frontend/src/explore/components/controls/DateFilterControl/frame/AdvancedFrame.tsx @@ -21,6 +21,7 @@ import { t } from '@superset-ui/core'; import { SEPARATOR } from 'src/explore/dateFilterUtils'; import { Input } from 'src/common/components'; import { FrameComponentProps } from '../types'; +import DateFunctionTooltip from './DateFunctionTooltip'; export function AdvancedFrame(props: FrameComponentProps) { const advancedRange = getAdvancedRange(props.value || ''); @@ -52,7 +53,12 @@ export function AdvancedFrame(props: FrameComponentProps) { return ( <> -
{t('Return to specific datetime.')}
+
+ datetime([string])
+
+
+ {`datetime("2020-03-01 12:00:00")
+datetime("now")
+datetime("last year")`}
+
+ {t('Moves the given set of dates by a specified interval.')}
+
+ {`dateadd([datetime], [integer], [dateunit])
+dateunit = (year | quarter | month | week | day | hour | minute | second)`}
+
+
+ {`dateadd(datetime("today"), -13, day)
+dateadd(datetime("2020-03-01"), 2, day)`}
+
+ + {t( + 'Truncates the specified date to the accuracy specified by the date unit.', + )} +
+
+ {`datetrunc([datetime], [dateunit])
+dateunit = (year | month | week)`}
+
+
+ {`datetrunc(datetime("2020-03-01"), week)
+datetrunc(datetime("2020-03-01"), month)`}
+
+ {t('Get the last date by the date unit.')}
+
+ {`lastday([datetime], [dateunit])
+dateunit = (year | month | week)`}
+
+
+ lastday(datetime("today"), month)
+
+ {t('Get the specify date for the holiday')}
+
+ {`holiday([string])
+holiday([holiday string], [datetime])
+holiday([holiday string], [datetime], [country name])`}
+
+
+ {`holiday("new year")
+holiday("christmas", datetime("2019"))
+holiday("christmas", dateadd(datetime("2019"), 1, year))
+holiday("christmas", datetime("2 years ago"))
+holiday("Easter Monday", datetime("2019"), "UK")`}
+
+