mirror of
https://github.com/textmate/textmate.git
synced 2026-04-28 03:00:34 -04:00
Use NSRelativeDateTimeFormatter when running on macOS 10.15
This commit is contained in:
@@ -51,7 +51,16 @@
|
||||
|
||||
- (void)updateLastPollString:(id)sender
|
||||
{
|
||||
self.lastPollString = [self.lastPoll humanReadableTimeElapsed];
|
||||
if(@available(macos 10.15, *))
|
||||
{
|
||||
NSRelativeDateTimeFormatter* formatter = [[NSRelativeDateTimeFormatter alloc] init];
|
||||
formatter.dateTimeStyle = NSRelativeDateTimeFormatterStyleNamed;
|
||||
self.lastPollString = [formatter localizedStringForDate:_lastPoll relativeToDate:NSDate.now];
|
||||
}
|
||||
else
|
||||
{
|
||||
self.lastPollString = [self.lastPoll humanReadableTimeElapsed];
|
||||
}
|
||||
}
|
||||
|
||||
- (void)setLastPoll:(NSDate*)aDate
|
||||
|
||||
Reference in New Issue
Block a user