Antidote-for-Tox / Antidote

No longer maintained
Mozilla Public License 2.0
391 stars 119 forks source link

Respect region settings when displaying time (12/24 hour format) #253

Open dvor opened 7 years ago

dvor commented 7 years ago

Currently Antidote always uses 24 hour format for displaying time.

trufae commented 7 years ago

I googled a bit and this seems to be the simplest way to detect the system settings in ObjC:

NSString *format = [NSDateFormatter dateFormatFromTemplate:@"j" options:0 locale:[NSLocale currentLocale]];
BOOL is24Hour = ([format rangeOfString:@"a"].location == NSNotFound);