From 9b46d364b0f0b2d4fe38d2d792179d3ee74bef1b Mon Sep 17 00:00:00 2001 From: Roman Kelesidis Date: Sun, 2 Apr 2023 16:23:26 +0700 Subject: [PATCH] Fixed broken predicting birthday year (#668) --- index.php | 2 +- library/ajax/index_data.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/index.php b/index.php index 1d4382707..0dc0d1632 100644 --- a/index.php +++ b/index.php @@ -363,7 +363,7 @@ if ($bb_cfg['birthday_check_day'] && $bb_cfg['birthday_enabled']) { $week_all = true; continue; } - $week_list[] = profile_url($week) . ' (' . birthday_age($week['user_birthday']) . ')'; + $week_list[] = profile_url($week) . ' (' . birthday_age(date('Y-m-d', strtotime('-1 year', strtotime($week['user_birthday'])))) . ')'; } $week_all = $week_all ? ' ...' : ''; $week_list = sprintf($lang['BIRTHDAY_WEEK'], $bb_cfg['birthday_check_day'], implode(', ', $week_list)) . $week_all; diff --git a/library/ajax/index_data.php b/library/ajax/index_data.php index 892ae6eeb..49ae9b971 100644 --- a/library/ajax/index_data.php +++ b/library/ajax/index_data.php @@ -27,7 +27,7 @@ switch ($mode) { if ($stats['birthday_week_list']) { foreach ($stats['birthday_week_list'] as $week) { - $users[] = profile_url($week) . ' (' . birthday_age($week['user_birthday']) . ')'; + $users[] = profile_url($week) . ' (' . birthday_age(date('Y-m-d', strtotime('-1 year', strtotime($week['user_birthday'])))) . ')'; } $html = sprintf($lang['BIRTHDAY_WEEK'], $bb_cfg['birthday_check_day'], implode(', ', $users)); } else {