I think this is a matter of interpretation. I agree with you that "Yesterday" is not a good naming for this because it leads to misinterpretation. For me "1 day ago" would be a better label here (this could be easily changed in custom/modules/SugarFeed/language/en_us.lang.php for example: "'LBL_TIME_YESTERDAY'=>'1 day ago',".
The other labels are ok for me. The advantage of this hourly-based interpretation - for me - is that "2 days ago" always means 48-72 hours ago, independent of the time I look at the feed.
If you want to change the behaviour you'd have to change function 'getTimeLapse' in modules/SugarFeed/SugarFeed.php (I'm not sure if a upgradesafe change in custom/... will work). Here the original code, taken from 6.2.0:
PHP Code:
static function getTimeLapse($startDate)
{
$seconds = $GLOBALS['timedate']->getNow()->ts - $GLOBALS['timedate']->fromUser($startDate)->ts;
$minutes = $seconds/60;
$seconds = $seconds % 60;
$hours = floor( $minutes / 60);
$minutes = $minutes % 60;
$days = floor( $hours / 24);
$hours = $hours % 24;
$weeks = floor( $days / 7);
$days = $days % 7;
$result = '';
if($weeks == 1){
$result = translate('LBL_TIME_LAST_WEEK','SugarFeed').' ';
return $result;
}else if($weeks > 1){
$result .= $weeks . ' '.translate('LBL_TIME_WEEKS','SugarFeed').' ';
if($days > 0) {
$result .= $days . ' '.translate('LBL_TIME_DAYS','SugarFeed').' ';
}
}else{
if($days == 1){
$result = translate('LBL_TIME_YESTERDAY','SugarFeed').' ';
return $result;
}else if($days > 1){
$result .= $days . ' '. translate('LBL_TIME_DAYS','SugarFeed').' ';
}else{
if($hours == 1) {
$result .= $hours . ' '.translate('LBL_TIME_HOUR','SugarFeed').' ';
} else {
$result .= $hours . ' '.translate('LBL_TIME_HOURS','SugarFeed').' ';
}
if($hours < 6){
if($minutes == 1) {
$result .= $minutes . ' ' . translate('LBL_TIME_MINUTE','SugarFeed'). ' ';
} else {
$result .= $minutes . ' ' . translate('LBL_TIME_MINUTES','SugarFeed'). ' ';
}
}
if($hours == 0 && $minutes == 0) {
if($seconds == 1 ) {
$result = $seconds . ' ' . translate('LBL_TIME_SECOND','SugarFeed');
} else {
$result = $seconds . ' ' . translate('LBL_TIME_SECONDS','SugarFeed');
}
}
}
}
return $result . ' ' . translate('LBL_TIME_AGO','SugarFeed');
}
Bookmarks