Skip to content

Commit

Permalink
[Feat/#75] 성공 로직 롤백
Browse files Browse the repository at this point in the history
  • Loading branch information
Zoe0929 committed Jul 31, 2024
1 parent 7e9ea34 commit a86351c
Showing 1 changed file with 16 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -141,15 +141,25 @@ final class ChallengeViewModel: ObservableObject {

let calendar = Calendar.current

for index in 0..<todayIndex {
if statuses[index] == "NONE" {
if let newDate = calendar.date(byAdding: .day, value: index, to: start) {
let formattedDate = dateFormatter.string(from: newDate)
dates.append(formattedDate)
if todayIndex >= 0 {
for index in 0..<todayIndex {
if statuses[index] == "NONE" {
if let newDate = calendar.date(byAdding: .day, value: index, to: start) {
let formattedDate = dateFormatter.string(from: newDate)
dates.append(formattedDate)
}
}
}
} else {
for index in 0..<days {
if statuses[index] == "NONE" {
if let newDate = calendar.date(byAdding: .day, value: index, to: start) {
let formattedDate = dateFormatter.string(from: newDate)
dates.append(formattedDate)
}
}
}
}

return dates
}
}
Expand Down

0 comments on commit a86351c

Please sign in to comment.