From 8226fe09408526604cfedb4424a7239dea6b1780 Mon Sep 17 00:00:00 2001 From: Marcel Werk Date: Thu, 1 Mar 2012 19:25:50 +0100 Subject: [PATCH] Fixed age calculation --- wcfsetup/install/files/lib/util/DateUtil.class.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/wcfsetup/install/files/lib/util/DateUtil.class.php b/wcfsetup/install/files/lib/util/DateUtil.class.php index 06e1a490f1..b98ad69308 100644 --- a/wcfsetup/install/files/lib/util/DateUtil.class.php +++ b/wcfsetup/install/files/lib/util/DateUtil.class.php @@ -268,8 +268,8 @@ class DateUtil { // calc if ($year) { $age = self::format(null, 'Y') - $year; - if (intval(self::format(null, 'n')) < intval($month)) $age--; - else if (intval(self::formatDate(null, 'j')) == intval($month) && self::formatDate(null, 'n') < intval($day)) $age--; + if (self::format(null, 'n') < $month) $age--; + else if (self::formatDate(null, 'n') == $month && self::formatDate(null, 'j') < $day) $age--; return $age; } -- 2.20.1