mirror of
https://github.com/friendica/friendica
synced 2025-04-30 07:04:23 +02:00
Changed:
- re-added `null` again https://github.com/friendica/friendica/pull/11900#discussion_r979248182 - removed null coalescing operator
This commit is contained in:
parent
2773ac9909
commit
c36da392f8
2 changed files with 7 additions and 4 deletions
|
@ -311,13 +311,16 @@ class Temporal
|
|||
*
|
||||
* @return string with relative date
|
||||
*/
|
||||
public static function getRelativeDate(string $posted_date, string $format = null): string
|
||||
public static function getRelativeDate(string $posted_date = null, string $format = null): string
|
||||
{
|
||||
$localtime = $posted_date . ' UTC';
|
||||
if (empty($posted_date) || $posted_date <= DBA::NULL_DATETIME) {
|
||||
return DI::l10n()->t('never');
|
||||
}
|
||||
|
||||
$localtime = $posted_date . ' UTC';
|
||||
$abs = strtotime($localtime);
|
||||
|
||||
if (empty($posted_date) || $posted_date <= DBA::NULL_DATETIME || $abs === false) {
|
||||
if ($abs === false) {
|
||||
return DI::l10n()->t('never');
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue