Browse Source

Fix truncation crash!

pull/92/head
Abhishek 5 years ago
parent
commit
c0caf1ee86
  1. 3
      Clocker/Panel/Data Layer/TimezoneDataOperations.swift

3
Clocker/Panel/Data Layer/TimezoneDataOperations.swift

@ -86,8 +86,11 @@ extension TimezoneDataOperations {
if shouldDayBeShown { if shouldDayBeShown {
var substring = date(with: 0, displayType: CLDateDisplayType.menuDisplay) var substring = date(with: 0, displayType: CLDateDisplayType.menuDisplay)
if (substring.count > 3) {
let endIndex = substring.index(substring.startIndex, offsetBy: 2) let endIndex = substring.index(substring.startIndex, offsetBy: 2)
substring = String(substring[substring.startIndex ... endIndex]) substring = String(substring[substring.startIndex ... endIndex])
}
if menuTitle.isEmpty == false { if menuTitle.isEmpty == false {
menuTitle.append(" \(substring.capitalized)") menuTitle.append(" \(substring.capitalized)")

Loading…
Cancel
Save