feat(creator-profile): 라이브 섹션 UI 변경

This commit is contained in:
Yu Sung
2025-10-17 06:17:36 +09:00
parent 491238a7eb
commit 3de1b2a7d6
5 changed files with 182 additions and 193 deletions

View File

@@ -54,4 +54,45 @@ extension String {
let dec = NSDecimalNumber(string: self)
return formatter.string(from: dec) ?? "\(currencyCode) \(self)"
}
func parseUtcIsoLocalDateTime() -> [String: String] {
// 1. : "yyyy-MM-dd'T'HH:mm:ss"
let utcFormatter = DateFormatter()
utcFormatter.dateFormat = "yyyy-MM-dd'T'HH:mm:ss"
utcFormatter.locale = Locale.current
utcFormatter.timeZone = TimeZone(abbreviation: "UTC")
// 2. Date
guard let date = utcFormatter.date(from: self) else {
return [:] //
}
// 3~6. Formatter ( )
let localFormatter = DateFormatter()
localFormatter.locale = Locale.autoupdatingCurrent
localFormatter.timeZone = TimeZone.current
// 3. (1~12)
localFormatter.dateFormat = "M"
let month = localFormatter.string(from: date)
// 4. (1~31)
localFormatter.dateFormat = "d"
let day = localFormatter.string(from: date)
// 5. (: "Mon", "")
localFormatter.dateFormat = "E"
let dayOfWeek = localFormatter.string(from: date)
// 6. (: "AM 05:00")
localFormatter.dateFormat = "a hh:mm"
let time = localFormatter.string(from: date)
return [
"month": month,
"day": day,
"dayOfWeek": dayOfWeek,
"time": time
]
}
}