Skip to content

Commit

Permalink
feat(ooo): show absence period
Browse files Browse the repository at this point in the history
Signed-off-by: Maksim Sukharev <[email protected]>
  • Loading branch information
Antreesy committed Dec 2, 2024
1 parent 5cc112f commit 8683e5d
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/components/NewMessage/NewMessageAbsenceInfo.vue
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
disable-tooltip />
</template>
<p class="absence-reminder__caption">{{ userAbsenceCaption }}</p>
<p v-if="userAbsencePeriod">{{ userAbsencePeriod }}</p>
<div v-if="userAbsence.replacementUserId" class="absence-reminder__replacement">
<!-- TRANSLATORS An acting person during the period of absence of the main contact -->
<p>{{ t('spreed','Replacement: ') }}</p>
Expand All @@ -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'
Expand Down Expand Up @@ -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: {
Expand Down

0 comments on commit 8683e5d

Please sign in to comment.