diff --git a/src/components/date/datemathHelp.vue b/src/components/date/datemathHelp.vue new file mode 100644 index 000000000..60aa05337 --- /dev/null +++ b/src/components/date/datemathHelp.vue @@ -0,0 +1,113 @@ + + + diff --git a/src/components/date/datepickerWithRange.vue b/src/components/date/datepickerWithRange.vue index 7b6bd2eec..2330ddec7 100644 --- a/src/components/date/datepickerWithRange.vue +++ b/src/components/date/datepickerWithRange.vue @@ -60,111 +60,7 @@ :overflow="true" variant="hint-modal" > - -

- {{ $t('input.datepickerRange.math.intro') }} -

-

- - now - || - -

-

- - - Grafana - - - Elasticsearch - - -

-

{{ $t('misc.forExample') }}

- -

{{ $t('input.datepickerRange.math.supportedUnits') }}

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
s{{ $t('input.datepickerRange.math.units.seconds') }}
m{{ $t('input.datepickerRange.math.units.minutes') }}
h{{ $t('input.datepickerRange.math.units.hours') }}
H{{ $t('input.datepickerRange.math.units.hours') }}
d{{ $t('input.datepickerRange.math.units.days') }}
w{{ $t('input.datepickerRange.math.units.weeks') }}
M{{ $t('input.datepickerRange.math.units.months') }}
y{{ $t('input.datepickerRange.math.units.years') }}
- -

{{ $t('input.datepickerRange.math.someExamples') }}

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
now{{ $t('input.datepickerRange.math.examples.now') }}
now+24h{{ $t('input.datepickerRange.math.examples.in24h') }}
now/d{{ $t('input.datepickerRange.math.examples.today') }}
now/w{{ $t('input.datepickerRange.math.examples.beginningOfThisWeek') }}
now/w+1w{{ $t('input.datepickerRange.math.examples.endOfThisWeek') }}
now+30d{{ $t('input.datepickerRange.math.examples.in30Days') }}
{{ exampleDate }}||+1M/d - - {{ exampleDate }} - -
-
+ @@ -179,11 +75,11 @@ import 'flatpickr/dist/flatpickr.css' import {computed, ref, watch} from 'vue' import {useI18n} from 'vue-i18n' import {store} from '@/store' -import {format} from 'date-fns' import Popup from '@/components/misc/popup.vue' import {dateRanges} from '@/components/date/dateRanges' import BaseButton from '@/components/base/BaseButton.vue' +import DatemathHelp from '@/components/date/datemathHelp.vue' const {t} = useI18n() @@ -204,7 +100,6 @@ const flatPickerConfig = computed(() => ({ })) const showHowItWorks = ref(false) -const exampleDate = format(new Date(), 'yyyy-MM-dd') const flatpickrRange = ref('')