This commit is contained in:
2025-07-25 17:30:11 -04:00
parent 310c120ca3
commit 3fd6887ce7
55 changed files with 1062 additions and 649 deletions

View File

@ -5,8 +5,15 @@ import SwiftData
final class Workout {
var start: Date = Date()
var end: Date?
var status: WorkoutStatus? = WorkoutStatus.notStarted
var status: Int = 1
// var status: WorkoutStatus = WorkoutStatus.notStarted
//case notStarted = 1
//case inProgress = 2
//case completed = 3
//case skipped = 4
@Relationship(deleteRule: .nullify)
var split: Split?
@ -20,10 +27,25 @@ final class Workout {
}
var label: String {
if status == .completed, let endDate = end {
if status == 3, let endDate = end {
// if status == .completed, let endDate = end {
return "\(start.formattedDate())\(endDate.formattedDate())"
} else {
return start.formattedDate()
}
}
var statusName: String {
if status == 1 {
return "Not Started"
} else if status == 2 {
return "In Progress"
} else if status == 3 {
return "Completed"
} else if status == 4 {
return "Skipped"
} else {
return "In progress"
}
}
}

View File

@ -11,6 +11,9 @@ final class WorkoutLog {
var order: Int = 0
var exerciseName: String = ""
var currentStateIndex: Int? = nil
var elapsedSeconds: Int? = nil
var completed: Bool = false
@Relationship(deleteRule: .nullify)