aboutsummaryrefslogtreecommitdiffstats
path: root/include/identity.php
diff options
context:
space:
mode:
authorfriendica <info@friendica.com>2014-05-01 18:40:00 -0700
committerfriendica <info@friendica.com>2014-05-01 18:40:00 -0700
commita39a1584bd6ebe5538af6be0f88ad06dd0e8033d (patch)
tree9d29fabdecfdceada99dd856a39727102938d705 /include/identity.php
parenta8322ba1f65d3cc82678103d86ac924fb6581e5e (diff)
downloadvolse-hubzilla-a39a1584bd6ebe5538af6be0f88ad06dd0e8033d.tar.gz
volse-hubzilla-a39a1584bd6ebe5538af6be0f88ad06dd0e8033d.tar.bz2
volse-hubzilla-a39a1584bd6ebe5538af6be0f88ad06dd0e8033d.zip
allow birthdays with just a year (no month or day).
Diffstat (limited to 'include/identity.php')
-rw-r--r--include/identity.php15
1 files changed, 10 insertions, 5 deletions
diff --git a/include/identity.php b/include/identity.php
index b66eaad51..4352f026a 100644
--- a/include/identity.php
+++ b/include/identity.php
@@ -953,15 +953,20 @@ function advanced_profile(&$a) {
if(($a->profile['dob']) && ($a->profile['dob'] != '0000-00-00')) {
+
+ $val = '';
+
+ if((substr($a->profile['dob'],5,2) === '00') || (substr($a->profile['dob'],8,2) === '00'))
+ $val = substr($a->profile['dob'],0,4);
$year_bd_format = t('j F, Y');
$short_bd_format = t('j F');
-
- $val = ((intval($a->profile['dob']))
- ? day_translate(datetime_convert('UTC','UTC',$a->profile['dob'] . ' 00:00 +00:00',$year_bd_format))
- : day_translate(datetime_convert('UTC','UTC','2001-' . substr($a->profile['dob'],5) . ' 00:00 +00:00',$short_bd_format)));
-
+ if(! $val) {
+ $val = ((intval($a->profile['dob']))
+ ? day_translate(datetime_convert('UTC','UTC',$a->profile['dob'] . ' 00:00 +00:00',$year_bd_format))
+ : day_translate(datetime_convert('UTC','UTC','2001-' . substr($a->profile['dob'],5) . ' 00:00 +00:00',$short_bd_format)));
+ }
$profile['birthday'] = array( t('Birthday:'), $val);
}