From 654fcb585a7cc509185bb60153b25619dc1eda02 Mon Sep 17 00:00:00 2001 From: "Petter H. Juliussen" Date: Wed, 6 Sep 2023 16:22:03 +0200 Subject: [PATCH] Add reusable period shortcut component --- src/components/drawers/EditObjective.vue | 34 +++++++---- src/components/period/PeriodSelector.vue | 39 ++++--------- src/components/period/PeriodShortcut.vue | 73 ++++++++++++++++++++++++ src/locale/locales/en-US.json | 3 +- src/locale/locales/nb-NO.json | 3 +- 5 files changed, 110 insertions(+), 42 deletions(-) create mode 100644 src/components/period/PeriodShortcut.vue diff --git a/src/components/drawers/EditObjective.vue b/src/components/drawers/EditObjective.vue index 8efaca8b0..aac967f65 100644 --- a/src/components/drawers/EditObjective.vue +++ b/src/components/drawers/EditObjective.vue @@ -42,15 +42,15 @@ rules="required" /> - - {{ formattedPeriod(newestObjective) }} - + :label="$t('admin.objective.useLastPeriod')" + :start-date="newestObjective.startDate.toDate()" + :end-date="newestObjective.endDate.toDate()" + :active="isSuggestedPeriod" + @click="useSuggestedPeriod" + />