Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions WeatherGroundServer.xm
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,10 @@
[self changeLabelTextWithAttributedString:temperatureAttrString];

dispatch_after(dispatch_time(DISPATCH_TIME_NOW, 3 * NSEC_PER_SEC), dispatch_get_main_queue(), ^{
NSDateFormatter *formatter = [NSDateFormatter new];
formatter.dateFormat = @"HH:mm";
NSString *format = [NSDateFormatter dateFormatFromTemplate:@"j" options:0 locale:[NSLocale currentLocale]];
BOOL is24Hour = ([format rangeOfString:@"a"].location == NSNotFound);
NSDateFormatter *formatter = [NSDateFormatter new];
formatter.dateFormat = [NSString stringWithFormat:@"%@:mm", (is24Hour ? "HH" : "hh")];
NSString *currentStatusTime = [formatter stringFromDate:[NSDate now]];

self.statusStringView.attributedText = nil;
Expand Down Expand Up @@ -248,4 +250,4 @@

return attrString;
}
@end
@end