From a820ea281320b77c33c0d97536f61f258e28ba55 Mon Sep 17 00:00:00 2001 From: Eugene Molotov Date: Sat, 4 Jan 2020 11:36:01 +0500 Subject: [PATCH 1/2] [VkBridge] Correct post date calculating Before this commit, post dates from december past year were calculated as december current year. --- bridges/VkBridge.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/bridges/VkBridge.php b/bridges/VkBridge.php index 713b86f337a..133a11f672c 100644 --- a/bridges/VkBridge.php +++ b/bridges/VkBridge.php @@ -374,6 +374,8 @@ private function getTime($post) } elseif (strstr($strdate, 'yesterday ') !== false) { $time = time() - 60 * 60 * 24; $strdate = date('d-m-Y', $time) . ' ' . $strdate; + } elseif ($date['month'] && intval(date('m')) < $date['month']) { + $strdate = $strdate . ' ' . (date('Y')-1); } else { $strdate = $strdate . ' ' . date('Y'); } From 47e43460238cf3043e4cadf6847e248e81ae41ca Mon Sep 17 00:00:00 2001 From: Eugene Molotov Date: Sat, 4 Jan 2020 11:44:00 +0500 Subject: [PATCH 2/2] lint --- bridges/VkBridge.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bridges/VkBridge.php b/bridges/VkBridge.php index 133a11f672c..ea81a2b210e 100644 --- a/bridges/VkBridge.php +++ b/bridges/VkBridge.php @@ -375,7 +375,7 @@ private function getTime($post) $time = time() - 60 * 60 * 24; $strdate = date('d-m-Y', $time) . ' ' . $strdate; } elseif ($date['month'] && intval(date('m')) < $date['month']) { - $strdate = $strdate . ' ' . (date('Y')-1); + $strdate = $strdate . ' ' . (date('Y') - 1); } else { $strdate = $strdate . ' ' . date('Y'); }