fix build error
This commit is contained in:
@@ -491,15 +491,6 @@ function calculateDurationForRange(workoutList, startDate, endDate) {
|
|||||||
.reduce((sum, w) => sum + (w.duration || 0), 0)
|
.reduce((sum, w) => sum + (w.duration || 0), 0)
|
||||||
}
|
}
|
||||||
|
|
||||||
function countWorkoutsForRange(workoutList, startDate, endDate) {
|
|
||||||
return workoutList.filter(w => {
|
|
||||||
const workoutDate = new Date(w.scheduled_date)
|
|
||||||
return workoutDate >= startDate &&
|
|
||||||
workoutDate <= endDate &&
|
|
||||||
w.status === 'completed'
|
|
||||||
}).length
|
|
||||||
}
|
|
||||||
|
|
||||||
const currentWeekTSS = computed(() => {
|
const currentWeekTSS = computed(() => {
|
||||||
const now = new Date()
|
const now = new Date()
|
||||||
const weekStart = getWeekStart(now)
|
const weekStart = getWeekStart(now)
|
||||||
@@ -538,26 +529,6 @@ const tssChangeClass = computed(() => {
|
|||||||
return 'tss-change-neutral'
|
return 'tss-change-neutral'
|
||||||
})
|
})
|
||||||
|
|
||||||
const currentWeekDuration = computed(() => {
|
|
||||||
const now = new Date()
|
|
||||||
const weekStart = getWeekStart(now)
|
|
||||||
const weekEnd = getWeekEnd(now)
|
|
||||||
const totalMinutes = calculateDurationForRange(workouts.value, weekStart, weekEnd)
|
|
||||||
const hours = Math.floor(totalMinutes / 60)
|
|
||||||
const minutes = totalMinutes % 60
|
|
||||||
if (hours > 0) {
|
|
||||||
return `${hours}h ${minutes}m`
|
|
||||||
}
|
|
||||||
return `${minutes}m`
|
|
||||||
})
|
|
||||||
|
|
||||||
const currentWeekWorkoutCount = computed(() => {
|
|
||||||
const now = new Date()
|
|
||||||
const weekStart = getWeekStart(now)
|
|
||||||
const weekEnd = getWeekEnd(now)
|
|
||||||
return countWorkoutsForRange(workouts.value, weekStart, weekEnd)
|
|
||||||
})
|
|
||||||
|
|
||||||
onMounted(async () => {
|
onMounted(async () => {
|
||||||
// Debug logging
|
// Debug logging
|
||||||
console.log('=== Frontend Debug Info ===')
|
console.log('=== Frontend Debug Info ===')
|
||||||
@@ -771,11 +742,6 @@ function truncateText(text, maxLength) {
|
|||||||
return text.substring(0, maxLength) + '...'
|
return text.substring(0, maxLength) + '...'
|
||||||
}
|
}
|
||||||
|
|
||||||
function getWorkoutColor(type) {
|
|
||||||
const typeObj = workoutTypes.value.find(t => t.name === type)
|
|
||||||
return typeObj?.color || '#667eea'
|
|
||||||
}
|
|
||||||
|
|
||||||
function getWorkoutIcon(type) {
|
function getWorkoutIcon(type) {
|
||||||
const typeObj = workoutTypes.value.find(t => t.name === type)
|
const typeObj = workoutTypes.value.find(t => t.name === type)
|
||||||
return typeObj?.icon || '🏋️'
|
return typeObj?.icon || '🏋️'
|
||||||
|
|||||||
Reference in New Issue
Block a user