From 36fdb4d33dd4df09e5523a49ad89e52a14e0a1fc Mon Sep 17 00:00:00 2001 From: Marc Alexander Date: Tue, 29 Oct 2013 13:43:13 +0100 Subject: [PATCH] [birthday/year_opt] Make year optional for displaying date in birthday ahead --- root/portal/modules/portal_birthday_list.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/root/portal/modules/portal_birthday_list.php b/root/portal/modules/portal_birthday_list.php index 8338f336..2b52e3c6 100644 --- a/root/portal/modules/portal_birthday_list.php +++ b/root/portal/modules/portal_birthday_list.php @@ -165,13 +165,13 @@ class portal_birthday_list_module */ protected function format_birthday($user, $birthday, $date_settings) { - if (!preg_match('/(?:[0-9])+-+(?:[0-9]{2})+-+(?:[0-9]{4})/', $birthday, $match)) + if (!preg_match('/(?:[0-9])+-+(?:[0-9]{2})+-+(?:[0-9]{4})?/', $birthday, $match)) { return ''; } $date = explode('-', $birthday); - $time = mktime(0, 0, 0, $date[1], $date[0], $date[2]); + $time = mktime(0, 0, 0, $date[1], $date[0], (isset($date[2])) ? $date[2] : 0); $lang_dates = array_filter($user->lang['datetime'], 'is_string'); return strtr(date($date_settings, $time), $lang_dates);