feat: add date math for filters #1342

Merged
konrad merged 88 commits from feature/date-math into main 2022-03-28 17:30:43 +00:00
1 changed files with 6 additions and 5 deletions
Showing only changes of commit 18f7adf420 - Show all commits

View File

@ -7,16 +7,16 @@
<template #content="{isOpen}">
<div class="datepicker-with-range" :class="{'is-open': isOpen}">
<div class="selections">
<button @click="setDateRange(null)" :class="{'is-active': customRangeActive}">
<BaseButton @click="setDateRange(null)" :class="{'is-active': customRangeActive}">
{{ $t('misc.custom') }}
</button>
<button
</BaseButton>
<BaseButton
v-for="(value, text) in dateRanges"
konrad marked this conversation as resolved Outdated

Use BaseButton

Use BaseButton

Done.

Done.
:key="text"
@click="setDateRange(value)"
:class="{'is-active': from === value[0] && to === value[1]}">
konrad marked this conversation as resolved Outdated

Use BaseButton

Use BaseButton

Done.

Done.
{{ $t(`input.datepickerRange.ranges.${text}`) }}
</button>
</BaseButton>
</div>
<div class="flatpickr-container input-group">
<label class="label">
@ -48,7 +48,7 @@
<p>
{{ $t('input.datepickerRange.math.canuse') }}
<a @click="showHowItWorks = true">{{ $t('input.datepickerRange.math.learnhow') }}</a>.
<BaseButton class="has-text-primary" @click="showHowItWorks = true">{{ $t('input.datepickerRange.math.learnhow') }}</BaseButton>
</p>
<modal
@ -181,6 +181,7 @@ 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'
const {t} = useI18n()