From d8ea0d9e88b5614170a59839f0ac707d29e5e878 Mon Sep 17 00:00:00 2001 From: Anton Date: Mon, 27 Nov 2023 10:01:12 +0100 Subject: [PATCH] Fix view mode --- .../repository_values/date_time_component.vue | 52 +++++++++++++++++-- 1 file changed, 48 insertions(+), 4 deletions(-) diff --git a/app/javascript/vue/repository_item_sidebar/repository_values/date_time_component.vue b/app/javascript/vue/repository_item_sidebar/repository_values/date_time_component.vue index 8f95a664e..6561f5912 100644 --- a/app/javascript/vue/repository_item_sidebar/repository_values/date_time_component.vue +++ b/app/javascript/vue/repository_item_sidebar/repository_values/date_time_component.vue @@ -1,9 +1,34 @@ @@ -71,6 +96,25 @@ case 'datetime': return this.i18n.t('repositories.item_card.repository_date_time_value.placeholder'); } + }, + viewPlaceholder() { + switch (this.mode) { + case 'date': + if (this.range) { + return this.i18n.t('repositories.item_card.repository_date_range_value.no_date_range'); + } + return this.i18n.t('repositories.item_card.repository_date_value.no_date'); + case 'time': + if (this.range) { + return this.i18n.t('repositories.item_card.repository_time_range_value.no_time_range'); + } + return this.i18n.t('repositories.item_card.repository_time_value.no_time'); + case 'datetime': + if (this.range) { + return this.i18n.t('repositories.item_card.repository_date_time_range_value.no_date_time_range'); + } + return this.i18n.t('repositories.item_card.repository_date_time_value.no_date_time'); + } } }, methods: {