Add Note contact field and fix birthday display

This commit is contained in:
Ilya Laktyushin
2019-11-13 20:21:30 +04:00
parent 8e2e882726
commit edb09cf389
13 changed files with 2737 additions and 2689 deletions

View File

@@ -93,10 +93,19 @@ public func stringForDate(timestamp: Int32, strings: PresentationStrings) -> Str
return formatter.string(from: Date(timeIntervalSince1970: Double(timestamp)))
}
public func stringForDateWithoutYear(date: Date, strings: PresentationStrings) -> String {
public func stringForDate(date: Date, timeZone: TimeZone? = TimeZone(secondsFromGMT: 0), strings: PresentationStrings) -> String {
let formatter = DateFormatter()
formatter.timeStyle = .none
formatter.timeZone = TimeZone(secondsFromGMT: 0)
formatter.dateStyle = .medium
formatter.timeZone = timeZone
formatter.locale = localeWithStrings(strings)
return formatter.string(from: date)
}
public func stringForDateWithoutYear(date: Date, timeZone: TimeZone? = TimeZone(secondsFromGMT: 0), strings: PresentationStrings) -> String {
let formatter = DateFormatter()
formatter.timeStyle = .none
formatter.timeZone = timeZone
formatter.locale = localeWithStrings(strings)
formatter.setLocalizedDateFormatFromTemplate("MMMMd")
return formatter.string(from: date)