라이브 예약 표시를 UTC 기준으로 변경
This commit is contained in:
@@ -60,7 +60,6 @@ struct LiveRoomResponse: Decodable {
|
||||
let title: String
|
||||
let content: String
|
||||
let isPaid: Bool
|
||||
let beginDateTime: String
|
||||
let beginDateTimeUtc: String
|
||||
let coverImageUrl: String
|
||||
let isAdult: Bool
|
||||
|
||||
@@ -203,12 +203,8 @@ final class UserProfileViewModel: 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)!
|
||||
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)
|
||||
@@ -218,6 +214,7 @@ final class UserProfileViewModel: ObservableObject {
|
||||
self.nowDate = now.convertDateFormat(dateFormat: "yyyy-MM-dd, HH:mm")
|
||||
self.paymentDialogDesc2 = I18n.MemberChannel.elapsedLiveWarning(hours: hours, minutes: minutes)
|
||||
}
|
||||
}
|
||||
|
||||
self.paymentDialogTitle = I18n.MemberChannel.paidLiveEnterTitle
|
||||
self.paymentDialogDesc = I18n.MemberChannel.paidLiveEnterDesc($0.price)
|
||||
|
||||
@@ -66,7 +66,6 @@ struct HomeLiveItemView: View {
|
||||
roomId: 1,
|
||||
title: "네네코 마사로네네코 마사로네네코 마사로네네코 마사로",
|
||||
content: "테스트",
|
||||
beginDateTime: "2025-08-10 15:00:00",
|
||||
beginDateTimeUtc: "2025-08-10T15:00:00",
|
||||
numberOfParticipate: 1,
|
||||
numberOfPeople: 10,
|
||||
|
||||
@@ -11,7 +11,6 @@ struct GetRoomListResponse: Decodable, Hashable {
|
||||
let roomId: Int
|
||||
let title: String
|
||||
let content: String
|
||||
let beginDateTime: String
|
||||
let beginDateTimeUtc: String
|
||||
let numberOfParticipate: Int
|
||||
let numberOfPeople: Int
|
||||
|
||||
@@ -368,12 +368,8 @@ 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)!
|
||||
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)
|
||||
@@ -383,6 +379,7 @@ final class LiveViewModel: ObservableObject {
|
||||
self.nowDate = now.convertDateFormat(dateFormat: "yyyy-MM-dd, HH:mm")
|
||||
self.paymentDialogDesc2 = "라이브를 시작한 지 \(hours)시간 \(minutes)분이 지났습니다. 라이브에 입장 후 30분 이내에 라이브가 종료될 수도 있습니다."
|
||||
}
|
||||
}
|
||||
|
||||
self.paymentDialogTitle = "유료 라이브 입장"
|
||||
self.paymentDialogDesc = "\($0.price)캔을 차감하고\n라이브에 입장 하시겠습니까?"
|
||||
|
||||
@@ -135,7 +135,6 @@ struct LiveNowAllItemView_Previews: PreviewProvider {
|
||||
roomId: 99,
|
||||
title: "testtesttesttesttesttesttesttesttesttesttesttesttesttesttesttest",
|
||||
content: "testtest",
|
||||
beginDateTime: "2022.05.23 Mon 03:00 PM",
|
||||
beginDateTimeUtc: "2025-08-10T15:00:00",
|
||||
numberOfParticipate: 3,
|
||||
numberOfPeople: 5,
|
||||
@@ -154,4 +153,3 @@ struct LiveNowAllItemView_Previews: PreviewProvider {
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -106,7 +106,6 @@ struct LiveNowItemView_Previews: PreviewProvider {
|
||||
roomId: 99,
|
||||
title: "testtesttesttesttesttesttesttesttesttesttesttesttesttesttesttest",
|
||||
content: "testtest",
|
||||
beginDateTime: "2022.05.23 Mon 03:00 PM",
|
||||
beginDateTimeUtc: "2025-08-10T15:00:00",
|
||||
numberOfParticipate: 3,
|
||||
numberOfPeople: 5,
|
||||
|
||||
@@ -33,7 +33,10 @@ struct LiveReservationAllItemView: View {
|
||||
|
||||
HStack(alignment: .top, spacing: 0) {
|
||||
VStack(alignment: .leading, spacing: 0) {
|
||||
Text(item.beginDateTime)
|
||||
let beginDateText = item.beginDateTimeUtc
|
||||
.parseUtcIsoDate()?
|
||||
.convertDateFormat(dateFormat: "yyyy.MM.dd EEE hh:mm a") ?? item.beginDateTimeUtc
|
||||
Text(beginDateText)
|
||||
.font(.custom(Font.medium.rawValue, size: 9.3))
|
||||
.foregroundColor(Color(hex: "ffd300"))
|
||||
|
||||
|
||||
@@ -126,7 +126,6 @@ struct LiveReservationItemView_Previews: PreviewProvider {
|
||||
roomId: 99,
|
||||
title: "test",
|
||||
content: "testtest",
|
||||
beginDateTime: "2022.05.23 Mon 03:00 PM",
|
||||
beginDateTimeUtc: "2025-08-10T15:00:00",
|
||||
numberOfParticipate: 0,
|
||||
numberOfPeople: 5,
|
||||
|
||||
@@ -185,7 +185,6 @@ struct MyLiveReservationItemView_Previews: PreviewProvider {
|
||||
roomId: 99,
|
||||
title: "test",
|
||||
content: "testtest",
|
||||
beginDateTime: "2022.05.23 Mon 03:00 PM",
|
||||
beginDateTimeUtc: "2025-08-10T15:00:00",
|
||||
numberOfParticipate: 0,
|
||||
numberOfPeople: 5,
|
||||
|
||||
@@ -18,7 +18,6 @@ struct GetRoomDetailResponse: Decodable {
|
||||
let password: String?
|
||||
let tags: [String]
|
||||
let channelName: String?
|
||||
let beginDateTime: String
|
||||
let beginDateTimeUtc: String
|
||||
let numberOfParticipants: Int
|
||||
let numberOfParticipantsTotal: Int
|
||||
|
||||
@@ -94,7 +94,7 @@ struct LiveDetailView: View {
|
||||
.padding(.top, 6.7)
|
||||
|
||||
HStack(spacing: 0) {
|
||||
let beginDateText = room.beginDateTimeUtc.parseUtcIsoDate()?.localizedDateTimeString() ?? room.beginDateTime
|
||||
let beginDateText = room.beginDateTimeUtc.parseUtcIsoDate()?.localizedDateTimeString() ?? room.beginDateTimeUtc
|
||||
Text(beginDateText)
|
||||
.font(.custom(Font.medium.rawValue, size: 12))
|
||||
.foregroundColor(Color(hex: "bbbbbb"))
|
||||
|
||||
@@ -55,15 +55,6 @@ final class LiveRoomEditViewModel: ObservableObject {
|
||||
if let beginDate = room!.beginDateTimeUtc.parseUtcIsoDate() {
|
||||
reservationDate = beginDate
|
||||
reservationTime = beginDate
|
||||
} else {
|
||||
let fromFormatter = DateFormatter()
|
||||
fromFormatter.dateFormat = "yyyy.MM.dd EEE hh:mm a"
|
||||
fromFormatter.locale = Locale(identifier: "en_US_POSIX")
|
||||
|
||||
if let legacyDate = fromFormatter.date(from: room!.beginDateTime) {
|
||||
reservationDate = legacyDate
|
||||
reservationTime = legacyDate
|
||||
}
|
||||
}
|
||||
|
||||
let beginDate = reservationDate.convertDateFormat(dateFormat: "yyyy-MM-dd")
|
||||
|
||||
@@ -85,7 +85,10 @@ struct LiveReservationCancelView: View {
|
||||
.cornerRadius(4.7)
|
||||
|
||||
VStack(alignment: .leading, spacing: 0) {
|
||||
Text(item.beginDateTime)
|
||||
let beginDateText = item.beginDateTimeUtc
|
||||
.parseUtcIsoDate()?
|
||||
.convertDateFormat(dateFormat: "yyyy.MM.dd EEE hh:mm a") ?? item.beginDateTimeUtc
|
||||
Text(beginDateText)
|
||||
.font(.custom(Font.medium.rawValue, size: 9.3))
|
||||
.foregroundColor(Color(hex: "ffd300"))
|
||||
|
||||
|
||||
@@ -14,6 +14,6 @@ struct GetLiveReservationResponse: Decodable, Hashable {
|
||||
let coverImageUrl: String
|
||||
let price: Int
|
||||
let masterNickname: String
|
||||
let beginDateTime: String
|
||||
let beginDateTimeUtc: String
|
||||
let cancelable: Bool
|
||||
}
|
||||
|
||||
@@ -29,7 +29,10 @@ struct LiveReservationStatusItemView: View {
|
||||
.cornerRadius(4.7)
|
||||
|
||||
VStack(alignment: .leading, spacing: 0) {
|
||||
Text(item.beginDateTime)
|
||||
let beginDateText = item.beginDateTimeUtc
|
||||
.parseUtcIsoDate()?
|
||||
.convertDateFormat(dateFormat: "yyyy.MM.dd EEE hh:mm a") ?? item.beginDateTimeUtc
|
||||
Text(beginDateText)
|
||||
.font(.custom(Font.medium.rawValue, size: 9.3))
|
||||
.foregroundColor(Color(hex: "ffd300"))
|
||||
|
||||
@@ -102,7 +105,7 @@ struct LiveReservationStatusItemView_Previews: PreviewProvider {
|
||||
coverImageUrl: "https://test-cf.sodalive.net/profile/default-profile.png",
|
||||
price: 0,
|
||||
masterNickname: "사냥꾼1004",
|
||||
beginDateTime: "2021.05.20 SUN 10p.m",
|
||||
beginDateTimeUtc: "2021-05-20T22:00:00",
|
||||
cancelable: false
|
||||
)
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user