Skip to content

Commit 9ebc7fc

Browse files
committed
feat: add hasCompletedTraining property and function to check for completed training events
1 parent 5270b67 commit 9ebc7fc

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

frontend/src/pages/Calendar.vue

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -473,6 +473,7 @@ interface CalendarDay {
473473
dayNumber: number
474474
isCurrentMonth: boolean
475475
isToday: boolean
476+
hasCompletedTraining: boolean
476477
trainingType: 'workout' | 'activity' | 'both' | null
477478
hasScheduledOnly: boolean
478479
isFrozenWeek: boolean
@@ -791,6 +792,10 @@ function getTrainingType(events: CalendarEvent[]): 'workout' | 'activity' | 'bot
791792
return null
792793
}
793794
795+
function hasCompletedTrainingEvents(events: CalendarEvent[]): boolean {
796+
return events.some(e => e.type === 'workout' || e.type === 'activity')
797+
}
798+
794799
function hasScheduledOnlyEvents(events: CalendarEvent[]): boolean {
795800
return (
796801
events.some(e => e.type === 'scheduled') &&

0 commit comments

Comments
 (0)