mirror of
https://github.com/friendica/friendica
synced 2025-04-29 21:04:24 +02:00
Replace remaining occurrences of "0001-01-01" with DBA::NULL_DATE
This commit is contained in:
parent
cf1c63fcc2
commit
d71e856535
6 changed files with 11 additions and 12 deletions
|
@ -740,7 +740,7 @@ class Contact extends BaseObject
|
|||
|
||||
// "bd" always contains the upcoming birthday of a contact.
|
||||
// "birthday" might contain the birthday including the year of birth.
|
||||
if ($profile["birthday"] > '0001-01-01') {
|
||||
if ($profile["birthday"] > DBA::NULL_DATE) {
|
||||
$bd_timestamp = strtotime($profile["birthday"]);
|
||||
$month = date("m", $bd_timestamp);
|
||||
$day = date("d", $bd_timestamp);
|
||||
|
@ -757,7 +757,7 @@ class Contact extends BaseObject
|
|||
$profile["bd"] = ( ++$current_year) . "-" . $month . "-" . $day;
|
||||
}
|
||||
} else {
|
||||
$profile["bd"] = '0001-01-01';
|
||||
$profile["bd"] = DBA::NULL_DATE;
|
||||
}
|
||||
} else {
|
||||
$profile = $default;
|
||||
|
@ -794,7 +794,7 @@ class Contact extends BaseObject
|
|||
$profile["location"] = "";
|
||||
$profile["about"] = "";
|
||||
$profile["gender"] = "";
|
||||
$profile["birthday"] = '0001-01-01';
|
||||
$profile["birthday"] = DBA::NULL_DATE;
|
||||
}
|
||||
|
||||
$cache[$url][$uid] = $profile;
|
||||
|
|
|
@ -864,7 +864,7 @@ class GContact
|
|||
'location' => $contact['location'], 'about' => $contact['about']];
|
||||
|
||||
// Don't update the birthday field if not set or invalid
|
||||
if (empty($contact['birthday']) || ($contact['birthday'] < '0001-01-01')) {
|
||||
if (empty($contact['birthday']) || ($contact['birthday'] <= DBA::NULL_DATE)) {
|
||||
unset($fields['bd']);
|
||||
}
|
||||
|
||||
|
|
|
@ -749,7 +749,7 @@ class Profile
|
|||
$profile['gender'] = [L10n::t('Gender:'), $a->profile['gender']];
|
||||
}
|
||||
|
||||
if (($a->profile['dob']) && ($a->profile['dob'] > '0001-01-01')) {
|
||||
if (!empty($a->profile['dob']) && $a->profile['dob'] > DBA::NULL_DATE) {
|
||||
$year_bd_format = L10n::t('j F, Y');
|
||||
$short_bd_format = L10n::t('j F');
|
||||
|
||||
|
@ -763,7 +763,7 @@ class Profile
|
|||
}
|
||||
|
||||
if (!empty($a->profile['dob'])
|
||||
&& $a->profile['dob'] > '0001-01-01'
|
||||
&& $a->profile['dob'] > DBA::NULL_DATE
|
||||
&& $age = Temporal::getAgeByTimezone($a->profile['dob'], $a->profile['timezone'], '')
|
||||
) {
|
||||
$profile['age'] = [L10n::t('Age:'), $age];
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue