Friendica: Allow month/day for birthdates

Created on 22 Jan 2018  路  2Comments  路  Source: friendica/friendica

At some point last year, I set my birthdate to 10-27 for October 27th, and my profile was successfully updated. However, the field had been changed to 0001-10-27, giving me 2016 years (don't I look young for my third millenia?)

This in turn prevented the update of my profile on all Diaspora pods, triggering the following error as found by @jaywink : https://friendica.mrpetovan.com/display/44ab9fb2-92fd-4fb5-97ce-db32224df8c6

We should either allow a missing year in the field or strip the year from the update message to Diaspora pods if it is 0001.

Bug Federation

Most helpful comment

When nulldates were converted from 0000-00-00 some months ago this code was changed: (dev/src/Protocol/Diaspora:~L4120

if (($profile['dob']) && ($profile['dob'] > '0001-01-01')) { $dob = ((intval($profile['dob'])) ? intval($profile['dob']) : '1000') .'-'. datetime_convert('UTC', 'UTC', $profile['dob'],'m-d'); }

Note the test line was converted to anything greater than 0001-01-01, but the next line checks only for the old null year of 0000 by casting the string to int using intval(). To preserve the original functionality this should probably read

if (($profile['dob']) && ($profile['dob'] > '0001-01-01')) { $dob = ((intval($profile['dob']) > 1) ? intval($profile['dob']) : '1000') .'-'. datetime_convert('UTC', 'UTC', $profile['dob'],'m-d'); }

All 2 comments

We should have a look into the whole birthday functionality.

When nulldates were converted from 0000-00-00 some months ago this code was changed: (dev/src/Protocol/Diaspora:~L4120

if (($profile['dob']) && ($profile['dob'] > '0001-01-01')) { $dob = ((intval($profile['dob'])) ? intval($profile['dob']) : '1000') .'-'. datetime_convert('UTC', 'UTC', $profile['dob'],'m-d'); }

Note the test line was converted to anything greater than 0001-01-01, but the next line checks only for the old null year of 0000 by casting the string to int using intval(). To preserve the original functionality this should probably read

if (($profile['dob']) && ($profile['dob'] > '0001-01-01')) { $dob = ((intval($profile['dob']) > 1) ? intval($profile['dob']) : '1000') .'-'. datetime_convert('UTC', 'UTC', $profile['dob'],'m-d'); }

Was this page helpful?
0 / 5 - 0 ratings

Related issues

AlfredSK picture AlfredSK  路  3Comments

MrPetovan picture MrPetovan  路  3Comments

nupplaphil picture nupplaphil  路  3Comments

hoergen picture hoergen  路  3Comments

AlfredSK picture AlfredSK  路  3Comments