chore: rename date ranges export
continuous-integration/drone/pr Build is failing Details

This commit is contained in:
kolaente 2022-02-06 19:33:52 +01:00
parent f435ca99f4
commit 60be8b428e
Signed by: konrad
GPG Key ID: F40E70337AB24C9B
3 changed files with 6 additions and 6 deletions

View File

@ -1,4 +1,4 @@
export const dateRanges = {
export const DATE_RANGES = {
// Format:
// Key is the title, as a translation string, the first entry of the value array
// is the "from" date, the second one is the "to" date.

View File

@ -11,7 +11,7 @@
{{ $t('misc.custom') }}
</BaseButton>
<BaseButton
v-for="(value, text) in dateRanges"
v-for="(value, text) in DATE_RANGES"
:key="text"
@click="setDateRange(value)"
:class="{'is-active': from === value[0] && to === value[1]}">
@ -78,7 +78,7 @@ import flatPickr from 'vue-flatpickr-component'
import 'flatpickr/dist/flatpickr.css'
import Popup from '@/components/misc/popup.vue'
import {dateRanges} from '@/components/date/dateRanges'
import {DATE_RANGES} from '@/components/date/dateRanges'
import BaseButton from '@/components/base/BaseButton.vue'
import DatemathHelp from '@/components/date/datemathHelp.vue'
@ -156,7 +156,7 @@ function setDateRange(range: string[] | null) {
}
const customRangeActive = computed<Boolean>(() => {
return !Object.values(dateRanges).some(el => from.value === el[0] && to.value === el[1])
return !Object.values(DateRanges).some(el => from.value === el[0] && to.value === el[1])
})
const buttonText = computed<string>(() => {

View File

@ -45,7 +45,6 @@
</template>
<script setup lang="ts">
import {dateRanges} from '@/components/date/dateRanges'
import SingleTaskInList from '@/components/tasks/partials/singleTaskInList.vue'
import {parseDateOrString} from '@/helpers/time/parseDateOrString'
import {mapState, useStore} from 'vuex'
@ -61,6 +60,7 @@ import {useRoute, useRouter} from 'vue-router'
import {formatDate} from '@/helpers/time/formatDate'
import {useI18n} from 'vue-i18n'
import {setTitle} from '@/helpers/setTitle'
import {DATE_RANGES} from '@/components/date/dateRanges'
function getNextWeekDate() {
return new Date((new Date()).getTime() + 7 * 24 * 60 * 60 * 1000)
@ -89,7 +89,7 @@ const pageTitle = computed(() => {
// We need to define "key" because it is the first parameter in the array and we need the second
// eslint-disable-next-line no-unused-vars
const predefinedRange = Object.entries(dateRanges).find(([key, value]) => dateFrom.value === value[0] && dateTo.value === value[1])
const predefinedRange = Object.entries(DATE_RANGES).find(([key, value]) => dateFrom.value === value[0] && dateTo.value === value[1])
if (typeof predefinedRange !== 'undefined') {
title = t(`input.datepickerRange.ranges.${predefinedRange[0]}`)
} else {