(web) Show time for messages of yesterday

Fixes #4599
pull/246/head
Francis Lachapelle 2018-11-22 10:38:40 -05:00
parent 4069158178
commit 6737aa3d0e
2 changed files with 4 additions and 4 deletions

1
NEWS
View File

@ -4,6 +4,7 @@
Enhancements
- [web] show source addressbook of matching contacts in appointment editor (#4579)
- [web] improve display of keyboard shortcuts
- [web] show time for messages of yesterday (#4599)
Bug fixes
- [sogo-tool] fixed "manage-acl unsubscribe" command (#4591)

View File

@ -126,14 +126,13 @@
else if ([now dayOfCommonEra] - [messageDate dayOfCommonEra] == 1)
{
// Yesterday
return [self labelForKey: @"Yesterday" inContext: context];
return [NSString stringWithFormat: @"%@ %@",
[self labelForKey: @"Yesterday" inContext: context],
[dateFormatter formattedTime: messageDate]];
}
else if ([now dayOfCommonEra] - [messageDate dayOfCommonEra] < 7)
{
// Same week
WOResourceManager *resMgr = [[WOApplication application] resourceManager];
NSString *language = [[[context activeUser] userDefaults] language];
NSDictionary *locale = [resMgr localeForLanguageNamed: language];
return [[locale objectForKey: NSWeekDayNameArray] objectAtIndex: [messageDate dayOfWeek]];
}
else