From 325b269b224615a9c584e0ec631a11d68bb24eb8 Mon Sep 17 00:00:00 2001 From: friendica Date: Tue, 11 Nov 2014 01:05:29 -0800 Subject: the code is a bit crufty, but this should fix issue #687 --- include/datetime.php | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) (limited to 'include') diff --git a/include/datetime.php b/include/datetime.php index 00bac8ad1..47c63e51d 100644 --- a/include/datetime.php +++ b/include/datetime.php @@ -134,10 +134,17 @@ function dob($dob) { if(! $f) $f = 'ymd'; - if ($dob && $dob != '0000-00-00') - $o = datesel($f,mktime(0,0,0,0,0,1900),mktime(),mktime(0,0,0,$month,$day,$year),'dob'); + if($dob === '0000-00-00') + $value = ''; else - $o = datesel($f,mktime(0,0,0,0,0,1900),mktime(),false,'dob'); + $value = (($year) ? datetime_convert('UTC','UTC',$dob,'Y-m-d') : datetime_convert('UTC','UTC',$dob,'m-d')); + + $o = ''; + +// if ($dob && $dob != '0000-00-00') +// $o = datesel($f,mktime(0,0,0,0,0,1900),mktime(),mktime(0,0,0,$month,$day,$year),'dob'); +// else +// $o = datesel($f,mktime(0,0,0,0,0,1900),mktime(),false,'dob'); return $o; } -- cgit v1.2.3