Skip to content

Commit

Permalink
refactor/#322 양식에 맞게 시간이 제대로 표현되도록 수정
Browse files Browse the repository at this point in the history
  • Loading branch information
JinUng41 committed Aug 24, 2024
1 parent db6f154 commit a1dc305
Showing 1 changed file with 7 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -144,15 +144,17 @@ private extension MeetingInfoViewModel {
let inputDateFormatter = DateFormatter()
inputDateFormatter.dateFormat = "yyyy-MM-dd HH:mm:ss"

let outputDateFormatter = DateFormatter()
outputDateFormatter.dateFormat = "yyyy.MM.dd a H:mm"
outputDateFormatter.amSymbol = "AM"
outputDateFormatter.pmSymbol = "PM"
let outputDateFormatter = DateFormatter().then {
$0.locale = Locale(identifier: "ko_KR")
$0.timeZone = TimeZone(identifier: "Asia/Seoul")
$0.dateFormat = "yyyy.MM.dd a h:mm"
$0.amSymbol = "AM"
$0.pmSymbol = "PM"
}

return promises.compactMap { promise in
guard let date = inputDateFormatter.date(from: promise.time) else { return nil }
let formattedDate = outputDateFormatter.string(from: date)

let (dateString, timeString) = splitDateAndTime(from: formattedDate)
let (dDayString, state) = configure(dDay: promise.dDay)

Expand Down

0 comments on commit a1dc305

Please sign in to comment.