feat: add more pre-defined ranges

This commit is contained in:
kolaente 2022-01-09 16:46:12 +01:00
parent e7fa1d3383
commit 0ae8a0e6ef
Signed by untrusted user who does not match committer: konrad
GPG key ID: F40E70337AB24C9B
4 changed files with 43 additions and 20 deletions

View file

@ -11,15 +11,15 @@
<template #content="{isOpen}">
<div class="datepicker-with-range" :class="{'is-open': isOpen}">
<div class="selections">
<button @click="setDateRange(null)" :class="{'is-active': customRangeActive}">
{{ $t('misc.custom') }}
</button>
<button
v-for="(value, text) in dateRanges"
:key="text"
@click="setDateRange(value)"
:class="{'is-active': from === value[0] && to === value[1]}">
{{ $t(text) }}
</button>
<button @click="setDateRange(null)" :class="{'is-active': customRangeActive}">
{{ $t('misc.custom') }}
{{ $t(`input.datepickerRange.ranges.${text}`) }}
</button>
</div>
<div class="flatpickr-container input-group">
@ -324,6 +324,7 @@ const customRangeActive = computed<Boolean>(() => {
display: flex;
flex-direction: column;
padding-top: .5rem;
overflow-y: scroll;
button {
display: block;