예약 업로드 추가

This commit is contained in:
Yu Sung
2024-01-10 17:08:22 +09:00
parent a27952bbca
commit c1e598a8bf
5 changed files with 281 additions and 63 deletions

View File

@@ -34,6 +34,7 @@ final class ContentCreateViewModel: ObservableObject {
}
@Published var isAvailableComment = true
@Published var isActiveReservation = false
@Published var isAdult = false
@Published var priceString = "0" {
didSet {
@@ -63,6 +64,20 @@ final class ContentCreateViewModel: ObservableObject {
@Published var previewStartTime: String = ""
@Published var previewEndTime: String = ""
@Published var releaseDateString: String = Date().convertDateFormat(dateFormat: "yyyy.MM.dd")
@Published var releaseTimeString: String = Date().convertDateFormat(dateFormat: "a hh:mm")
var releaseDate = Date() {
willSet {
releaseDateString = newValue.convertDateFormat(dateFormat: "yyyy.MM.dd")
}
}
var releaseTime = Date() {
willSet {
releaseTimeString = newValue.convertDateFormat(dateFormat: "a hh:mm")
}
}
var placeholder = "내용을 입력하세요"
@@ -75,6 +90,8 @@ final class ContentCreateViewModel: ObservableObject {
detail: detail,
tags: hashtags,
price: price,
releaseDate: isActiveReservation ? "\(releaseDate.convertDateFormat(dateFormat: "yyyy-MM-dd")) \(releaseTime.convertDateFormat(dateFormat: "HH:mm"))" : nil,
timezone: TimeZone.current.identifier,
themeId: theme!.id,
isAdult: isAdult,
isOnlyRental: isOnlyRental,