diff --git a/src/components/CalendarEventsDialog.vue b/src/components/CalendarEventsDialog.vue index 12c16cf1847..710bba50c7e 100644 --- a/src/components/CalendarEventsDialog.vue +++ b/src/components/CalendarEventsDialog.vue @@ -37,7 +37,7 @@ import TransitionWrapper from './UIShared/TransitionWrapper.vue' import { ATTENDEE, CONVERSATION } from '../constants.ts' import { hasTalkFeature } from '../services/CapabilitiesManager.ts' import { useGroupwareStore } from '../stores/groupware.ts' -import { convertToUnix, ONE_HOUR_IN_MS } from '../utils/formattedTime.ts' +import { convertToUnix, formatDateTime, getDiffInDays, ONE_HOUR_IN_MS } from '../utils/formattedTime.ts' import { getDisplayNameWithFallback } from '../utils/getDisplayName.ts' const props = defineProps<{ @@ -77,6 +77,28 @@ const upcomingEvents = computed(() => { }) }) +const upcomingEventTime = computed(() => { + const eventStart = upcomingEvents.value[0]!.start + + if (typeof eventStart === 'string') { + // Now + return eventStart + } + + const diffInDays = getDiffInDays(eventStart) + + if (diffInDays === 0) { + // Today + return formatDateTime(eventStart, 'shortTime') + } else if (diffInDays < 7) { + // Within a week + return formatDateTime(eventStart, 'shortWeekdayWithTime') + } + + const isSameYear = new Date(eventStart).getFullYear() === new Date().getFullYear() + return formatDateTime(eventStart, isSameYear ? 'shortDateSameYear' : 'shortDate') +}) + type CalendarOption = { value: string, label: string, color: string } const calendarOptions = computed(() => groupwareStore.writeableCalendars.map((calendar) => ({ value: calendar.uri, @@ -349,14 +371,14 @@ async function submitNewMeeting() { class="upcoming-meeting" :title="t('spreed', 'Upcoming meetings')" :aria-label="t('spreed', 'Upcoming meetings')"> - + @@ -651,20 +673,9 @@ async function submitNewMeeting() { } .upcoming-meeting { - // Overwrite default NcButton styles - :deep(.button-vue__text) { - padding-block: 0; - margin: 0; - display: flex; - flex-direction: column; - align-items: flex-start; - line-height: 20px; + &__time { font-weight: 400; } - - &__header { - font-weight: 500; - } } .calendar-badge { diff --git a/src/components/TopBar/TopBar.vue b/src/components/TopBar/TopBar.vue index 6e86aa7297e..aa1a81f6cb3 100644 --- a/src/components/TopBar/TopBar.vue +++ b/src/components/TopBar/TopBar.vue @@ -99,9 +99,6 @@ - - - + + + + + - -