@@ -8,10 +8,9 @@ import type { INode } from '@nextcloud/files'
88
99import { showError , showSuccess } from ' @nextcloud/dialogs'
1010import { emit as emitEventBus } from ' @nextcloud/event-bus'
11- import { t } from ' @nextcloud/l10n'
12- import { onBeforeMount , onMounted , ref } from ' vue'
11+ import { formatRelativeTime , t } from ' @nextcloud/l10n'
12+ import { computed , onBeforeMount , onMounted , ref } from ' vue'
1313import NcButton from ' @nextcloud/vue/components/NcButton'
14- import NcDateTime from ' @nextcloud/vue/components/NcDateTime'
1514import NcDateTimePickerNative from ' @nextcloud/vue/components/NcDateTimePickerNative'
1615import NcDialog from ' @nextcloud/vue/components/NcDialog'
1716import NcNoteCard from ' @nextcloud/vue/components/NcNoteCard'
@@ -33,6 +32,15 @@ const isValid = ref(true)
3332const customDueDate = ref <Date >()
3433const nowDate = ref (new Date ())
3534
35+ const informationText = computed (() => {
36+ const relativeDueDate = formatRelativeTime (customDueDate .value ?? 0 )
37+ return (nowDate .value .getTime () >= (customDueDate .value ?.getTime () ?? 0 ))
38+ // TRANSLATORS: {relativeDueDate} will be replaced with a relative time, e.g. "2 hours ago" or "in 3 days".
39+ ? t (' files_reminders' , ' We reminded you of this file {relativeDueDate}' , { relativeDueDate })
40+ // TRANSLATORS: {relativeDueDate} will be replaced with a relative time, e.g. "2 hours ago" or "in 3 days".
41+ : t (' files_reminders' , ' We will remind you of this file {relativeDueDate}' , { relativeDueDate })
42+ })
43+
3644onBeforeMount (() => {
3745 const dueDate = props .node .attributes [' reminder-due-date' ]
3846 ? new Date (props .node .attributes [' reminder-due-date' ])
@@ -132,8 +140,7 @@ function onInput(): void {
132140 @input =" onInput" />
133141
134142 <NcNoteCard v-if =" isValid && customDueDate" type =" info" >
135- {{ t('files_reminders', 'We will remind you of this file') }}
136- <NcDateTime :timestamp =" customDueDate" />
143+ {{ informationText }}
137144 </NcNoteCard >
138145
139146 <NcNoteCard v-else type =" error" >
0 commit comments