feat(chat): 날짜 구분선 현지화 포매터를 추가한다
This commit is contained in:
+16
@@ -0,0 +1,16 @@
|
||||
import Foundation
|
||||
|
||||
enum UserCreatorChatDatePresentation {
|
||||
static func title(for date: Date, locale: Locale, calendar: Calendar, timeZone: TimeZone) -> String {
|
||||
var calendar = calendar
|
||||
calendar.timeZone = timeZone
|
||||
|
||||
let formatter = DateFormatter()
|
||||
formatter.locale = locale
|
||||
formatter.timeZone = timeZone
|
||||
formatter.calendar = calendar
|
||||
formatter.doesRelativeDateFormatting = false
|
||||
formatter.setLocalizedDateFormatFromTemplate("yMMMMdEEEE")
|
||||
return formatter.string(from: date)
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user