]> git.mxchange.org Git - friendica.git/blobdiff - src/Util/Temporal.php
Fix urlpath determination on the root page
[friendica.git] / src / Util / Temporal.php
index e200d9073a41fe1e37a76efc93adb868106f3b6b..46bd8bba50871deafc49449891feb330de8ebe70 100644 (file)
@@ -59,7 +59,7 @@ class Temporal
 
                $o = '<select id="timezone_select" name="timezone">';
 
-               usort($timezone_identifiers, [self, 'timezoneCompareCallback']);
+               usort($timezone_identifiers, [__CLASS__, 'timezoneCompareCallback']);
                $continent = '';
                foreach ($timezone_identifiers as $value) {
                        $ex = explode("/", $value);
@@ -127,6 +127,8 @@ class Temporal
         */
        public static function getDateofBirthField($dob)
        {
+               $a = get_app();
+
                list($year, $month, $day) = sscanf($dob, '%4d-%2d-%2d');
 
                if ($dob < '0000-01-01') {
@@ -135,7 +137,7 @@ class Temporal
                        $value = DateTimeFormat::utc(($year > 1000) ? $dob : '1000-' . $month . '-' . $day, 'Y-m-d');
                }
 
-               $age = (intval($value) ? age($value, $a->user["timezone"], $a->user["timezone"]) : "");
+               $age = (intval($value) ? self::getAgeByTimezone($value, $a->user["timezone"], $a->user["timezone"]) : "");
 
                $tpl = get_markup_template("field_input.tpl");
                $o = replace_macros($tpl,
@@ -165,7 +167,7 @@ class Temporal
         */
        public static function getDateField($min, $max, $default, $id = 'datepicker')
        {
-               return datetimesel($min, $max, $default, '', $id, true, false, '', '');
+               return self::getDateTimeField($min, $max, $default, '', $id, true, false, '', '');
        }
 
        /**
@@ -179,7 +181,7 @@ class Temporal
         */
        public static function getTimeField($h, $m, $id = 'timepicker')
        {
-               return datetimesel(new DateTime(), new DateTime(), new DateTime("$h:$m"), '', $id, false, true);
+               return self::getDateTimeField(new DateTime(), new DateTime(), new DateTime("$h:$m"), '', $id, false, true);
        }
 
        /**
@@ -393,7 +395,7 @@ class Temporal
         *
         * @return string day 0 = Sunday through 6 = Saturday
         */
-       public static function getFirstDayInMonth($y, $m)
+       private static function getFirstDayInMonth($y, $m)
        {
                $d = sprintf('%04d-%02d-01 00:00', intval($y), intval($m));
 
@@ -438,8 +440,8 @@ class Temporal
                }
 
                $dn = ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'];
-               $f = get_first_dim($y, $m);
-               $l = get_dim($y, $m);
+               $f = self::getFirstDayInMonth($y, $m);
+               $l = self::getDaysInMonth($y, $m);
                $d = 1;
                $dow = 0;
                $started = false;