From 8683e5d7c927edd5815f976bc49780c09a3ba6b8 Mon Sep 17 00:00:00 2001 From: Maksim Sukharev Date: Mon, 2 Dec 2024 13:07:59 +0100 Subject: [PATCH] feat(ooo): show absence period Signed-off-by: Maksim Sukharev --- src/components/NewMessage/NewMessageAbsenceInfo.vue | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/components/NewMessage/NewMessageAbsenceInfo.vue b/src/components/NewMessage/NewMessageAbsenceInfo.vue index 5d859b8031c..7cab5774dc8 100644 --- a/src/components/NewMessage/NewMessageAbsenceInfo.vue +++ b/src/components/NewMessage/NewMessageAbsenceInfo.vue @@ -16,6 +16,7 @@ disable-tooltip />

{{ userAbsenceCaption }}

+

{{ userAbsencePeriod }}

{{ t('spreed','Replacement: ') }}

@@ -42,6 +43,7 @@ import ChevronUp from 'vue-material-design-icons/ChevronUp.vue' import { t } from '@nextcloud/l10n' +import moment from '@nextcloud/moment' import NcButton from '@nextcloud/vue/dist/Components/NcButton.js' import NcNoteCard from '@nextcloud/vue/dist/Components/NcNoteCard.js' @@ -102,6 +104,16 @@ export default { userAbsenceMessage() { return this.userAbsence.message || this.userAbsence.shortMessage }, + + userAbsencePeriod() { + if (!this.userAbsence.startDate || !this.userAbsence.endDate) { + return '' + } + return t('spreed', 'Absence period: {startDate} - {endDate}', { + startDate: moment.unix(this.userAbsence.startDate).format('ll'), + endDate: moment.unix(this.userAbsence.endDate).format('ll'), + }) + }, }, watch: {