From 6c90bd1d0f54f7329f4e03a3846becbf9f04915f Mon Sep 17 00:00:00 2001 From: veselcraft Date: Mon, 24 Jan 2022 16:16:24 +0300 Subject: [PATCH] Date: Hide seconds if smth was created today or ACTUALLY yesterday --- Web/Util/DateTime.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Web/Util/DateTime.php b/Web/Util/DateTime.php index 2bcb0f9d..464f10c9 100644 --- a/Web/Util/DateTime.php +++ b/Web/Util/DateTime.php @@ -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 {