diff --git a/frontend/src/components/date/dateRanges.ts b/frontend/src/components/date/dateRanges.ts index 648f001b4..556c21c1f 100644 --- a/frontend/src/components/date/dateRanges.ts +++ b/frontend/src/components/date/dateRanges.ts @@ -19,3 +19,28 @@ export const DATE_RANGES = { 'thisYear': ['now/y', 'now/y+1y'], 'restOfThisYear': ['now', 'now/y+1y'], } + +export const DATE_VALUES = { + 'now': 'now', + 'startOfToday': 'now/d', + 'endOfToday': 'now/d+1d', + + 'beginningOflastWeek': 'now/w-1w', + 'endOfLastWeek': 'now/w-2w', + 'beginningOfThisWeek': 'now/w', + 'endOfThisWeek': 'now/w+1w', + 'startOfNextWeek': 'now/w+1w', + 'endOfNextWeek': 'now/w+2w', + 'in7Days': 'now+7d', + + 'beginningOfLastMonth': 'now/M-1M', + 'endOfLastMonth': 'now/M-2M', + 'startOfThisMonth': 'now/M', + 'endOfThisMonth': 'now/M+1M', + 'startOfNextMonth': 'now/M+1M', + 'endOfNextMonth': 'now/M+2M', + 'in30Days': 'now+30d', + + 'startOfThisYear': 'now/y', + 'endOfThisYear': 'now/y+1y', +} diff --git a/frontend/src/components/date/datepickerWithValues.vue b/frontend/src/components/date/datepickerWithValues.vue index 96c827a01..dd9259103 100644 --- a/frontend/src/components/date/datepickerWithValues.vue +++ b/frontend/src/components/date/datepickerWithValues.vue @@ -17,12 +17,12 @@ {{ $t('misc.custom') }} - {{ $t(`input.datepickerRange.ranges.${text}`) }} + {{ $t(`input.datepickerRange.values.${text}`) }}
@@ -86,7 +86,7 @@ import 'flatpickr/dist/flatpickr.css' import {parseDateOrString} from '@/helpers/time/parseDateOrString' import Popup from '@/components/misc/popup.vue' -import {DATE_RANGES} from '@/components/date/dateRanges' +import {DATE_VALUES} from '@/components/date/dateRanges' import BaseButton from '@/components/base/BaseButton.vue' import DatemathHelp from '@/components/date/datemathHelp.vue' import {getFlatpickrLanguage} from '@/helpers/flatpickrLanguage' @@ -162,7 +162,7 @@ function setDate(range: string | null) { } const customRangeActive = computed(() => { - return !Object.values(DATE_RANGES).some(d => date.value === d) + return !Object.values(DATE_VALUES).some(d => date.value === d) }) diff --git a/frontend/src/i18n/lang/en.json b/frontend/src/i18n/lang/en.json index ae2a5ca59..a514b969c 100644 --- a/frontend/src/i18n/lang/en.json +++ b/frontend/src/i18n/lang/en.json @@ -588,6 +588,7 @@ "to": "To", "from": "From", "fromto": "{from} to {to}", + "date": "Date", "ranges": { "today": "Today", @@ -605,6 +606,30 @@ "thisYear": "This Year", "restOfThisYear": "The Rest of This Year" + }, + "values": { + "now": "Now", + "startOfToday": "Start of today", + "endOfToday": "End of today", + + "beginningOflastWeek": "Beginning of last week", + "endOfLastWeek": "End of last week", + "beginningOfThisWeek": "Beginning of this week", + "endOfThisWeek": "End of this week", + "startOfNextWeek": "Start of next week", + "endOfNextWeek": "End of next week", + "in7Days": "In 7 days", + + "beginningOfLastMonth": "Beginning of last month", + "endOfLastMonth": "End of last month", + "startOfThisMonth": "Start of this month", + "endOfThisMonth": "End of this month", + "startOfNextMonth": "Start of next month", + "endOfNextMonth": "End of next month", + "in30Days": "In 30 days", + + "startOfThisYear": "Beginning of this year", + "endOfThisYear": "End of this year" } }, "datemathHelp": {