From 3484ad2aafcd6f7804f5e9fc249af427a1b71ff7 Mon Sep 17 00:00:00 2001 From: Michael Kuhn Date: Sun, 9 Dec 2018 18:28:15 +0100 Subject: [PATCH] Use IYYY in combination with IW Otherwise, we could end up with a wrong date, see: https://community.oracle.com/thread/997899 --- classes/feeds.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/classes/feeds.php b/classes/feeds.php index c31f4b676..6a16cd85b 100755 --- a/classes/feeds.php +++ b/classes/feeds.php @@ -1698,7 +1698,7 @@ class Feeds extends Handler_Protected { if (DB_TYPE == "pgsql") { $sanity_interval_qpart = "date_entered >= NOW() - INTERVAL '1 hour' AND"; - $yyiw_qpart = "to_char(date_entered, 'YYYY-IW') AS yyiw"; + $yyiw_qpart = "to_char(date_entered, 'IYYY-IW') AS yyiw"; } else { $sanity_interval_qpart = "date_entered >= DATE_SUB(NOW(), INTERVAL 1 hour) AND"; $yyiw_qpart = "concat(year(date_entered),lpad(weekofyear(date_entered), 2, '0')) AS yyiw";