Date: Hide seconds if smth was created today or ACTUALLY yesterday

This commit is contained in:
veselcraft 2022-01-24 16:16:24 +03:00
parent 4ae74841e0
commit 6c90bd1d0f
No known key found for this signature in database
GPG key ID: AED66BC1AC628A4E

View file

@ -31,7 +31,7 @@ class DateTime
else
return $diff->i === 5 ? tr("time_exactly_five_minutes_ago") : tr("time_minutes_ago", $diff->i);
} else if($this->timestamp >= strtotime("-1day midnight")) { # Yesterday
return tr("time_yesterday") . tr("time_at_sp") . ovk_strftime_safe("%X", $this->timestamp);
return tr("time_yesterday") . tr("time_at_sp") . ovk_strftime_safe(" %R %p", $this->timestamp);
} else if(ovk_strftime_safe("%Y", $this->timestamp) === ovk_strftime_safe("%Y", time())) { # In this year
return ovk_strftime_safe("%e %h ", $this->timestamp) . tr("time_at_sp") . ovk_strftime_safe(" %R %p", $this->timestamp);
} else {