라이브 예약 표시를 UTC 기준으로 변경
This commit is contained in:
@@ -368,20 +368,17 @@ final class LiveViewModel: ObservableObject {
|
||||
}
|
||||
self.isShowPasswordDialog = true
|
||||
} else {
|
||||
let fromFormatter = DateFormatter()
|
||||
fromFormatter.dateFormat = "yyyy.MM.dd EEE hh:mm a"
|
||||
fromFormatter.locale = Locale(identifier: "en_US_POSIX")
|
||||
let beginDate = fromFormatter.date(from: $0.beginDateTime)!
|
||||
let now = Date()
|
||||
|
||||
let timeInterval = now.timeIntervalSince(beginDate)
|
||||
let hours = Int(timeInterval / 3600)
|
||||
let minutes = Int((timeInterval.truncatingRemainder(dividingBy: 3600)) / 60)
|
||||
|
||||
if hours >= 1 {
|
||||
self.liveStartDate = beginDate.convertDateFormat(dateFormat: "yyyy-MM-dd, HH:mm")
|
||||
self.nowDate = now.convertDateFormat(dateFormat: "yyyy-MM-dd, HH:mm")
|
||||
self.paymentDialogDesc2 = "라이브를 시작한 지 \(hours)시간 \(minutes)분이 지났습니다. 라이브에 입장 후 30분 이내에 라이브가 종료될 수도 있습니다."
|
||||
if let beginDate = $0.beginDateTimeUtc.parseUtcIsoDate() {
|
||||
let now = Date()
|
||||
let timeInterval = now.timeIntervalSince(beginDate)
|
||||
let hours = Int(timeInterval / 3600)
|
||||
let minutes = Int((timeInterval.truncatingRemainder(dividingBy: 3600)) / 60)
|
||||
|
||||
if hours >= 1 {
|
||||
self.liveStartDate = beginDate.convertDateFormat(dateFormat: "yyyy-MM-dd, HH:mm")
|
||||
self.nowDate = now.convertDateFormat(dateFormat: "yyyy-MM-dd, HH:mm")
|
||||
self.paymentDialogDesc2 = "라이브를 시작한 지 \(hours)시간 \(minutes)분이 지났습니다. 라이브에 입장 후 30분 이내에 라이브가 종료될 수도 있습니다."
|
||||
}
|
||||
}
|
||||
|
||||
self.paymentDialogTitle = "유료 라이브 입장"
|
||||
|
||||
Reference in New Issue
Block a user