]> git.mxchange.org Git - friendica.git/blobdiff - src/Util/Temporal.php
Merge pull request #10596 from annando/mark-file-star-for-all
[friendica.git] / src / Util / Temporal.php
index c4a04d586cb266cd32d647617fe99056bdd420f6..b5619cf49cbce0a273d61b608e6ff1e722fdf48e 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /**
- * @copyright Copyright (C) 2020, Friendica
+ * @copyright Copyright (C) 2010-2021, the Friendica project
  *
  * @license GNU AGPL version 3 or any later version
  *
@@ -225,7 +225,7 @@ class Temporal
        public static function getDateTimeField(
                DateTime $minDate,
                DateTime $maxDate,
-               DateTime $defaultDate,
+               DateTime $defaultDate = null,
                $label,
                $id       = 'datetimepicker',
                $pickdate = true,
@@ -366,7 +366,7 @@ class Temporal
         * @return int Age in years
         * @throws \Exception
         */
-       public static function getAgeByTimezone($dob, $owner_tz = '')
+       public static function getAgeByTimezone($dob, $owner_tz = ''): int
        {
                if (!intval($dob)) {
                        return 0;
@@ -381,7 +381,7 @@ class Temporal
 
                $interval = $birthdate->diff($currentDate);
 
-               return $interval->format('%y');
+               return (int) $interval->format('%y');
        }
 
        /**