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