From 04f9aa82c3d4a2818e317920f93889b0e9c7d88e Mon Sep 17 00:00:00 2001 From: Roman Kelesidis Date: Sat, 1 Apr 2023 00:50:29 +0700 Subject: [PATCH] Fixed broken predicting birthday year (#93) --- 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 7dc7b44a..68f7ba68 100644 --- a/index.php +++ b/index.php @@ -380,7 +380,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']-1) .')'; + $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'], join(', ', $week_list)) . $week_all; diff --git a/library/ajax/index_data.php b/library/ajax/index_data.php index debd9fcd..3f111d93 100644 --- a/library/ajax/index_data.php +++ b/library/ajax/index_data.php @@ -19,7 +19,7 @@ switch($mode) { foreach($stats['birthday_week_list'] as $week) { - $html[] = profile_url($week) .' ('. birthday_age($week['user_birthday']) .')'; + $html[] = 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'], join(', ', $html)); }