(web) Show time for messages of yesterday

Fixes #4599
This commit is contained in:
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 Enhancements
- [web] show source addressbook of matching contacts in appointment editor (#4579) - [web] show source addressbook of matching contacts in appointment editor (#4579)
- [web] improve display of keyboard shortcuts - [web] improve display of keyboard shortcuts
- [web] show time for messages of yesterday (#4599)
Bug fixes Bug fixes
- [sogo-tool] fixed "manage-acl unsubscribe" command (#4591) - [sogo-tool] fixed "manage-acl unsubscribe" command (#4591)

View file

@ -126,14 +126,13 @@
else if ([now dayOfCommonEra] - [messageDate dayOfCommonEra] == 1) else if ([now dayOfCommonEra] - [messageDate dayOfCommonEra] == 1)
{ {
// Yesterday // 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) else if ([now dayOfCommonEra] - [messageDate dayOfCommonEra] < 7)
{ {
// Same week // 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]]; return [[locale objectForKey: NSWeekDayNameArray] objectAtIndex: [messageDate dayOfWeek]];
} }
else else