Browse Source

Fix truncation crash!

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

7
Clocker/Panel/Data Layer/TimezoneDataOperations.swift

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

Loading…
Cancel
Save