Fix wrong self references in Util\Temporal

This commit is contained in:
Hypolite Petovan 2018-01-27 08:11:49 -05:00
parent 5518ef2fb4
commit bb5670016e

View File

@ -132,7 +132,7 @@ class Temporal
if ($dob < '0000-01-01') { if ($dob < '0000-01-01') {
$value = ''; $value = '';
} else { } else {
$value = self::utc(($year > 1000) ? $dob : '1000-' . $month . '-' . $day, 'Y-m-d'); $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) ? age($value, $a->user["timezone"], $a->user["timezone"]) : "");
@ -368,11 +368,11 @@ class Temporal
$viewer_tz = date_default_timezone_get(); $viewer_tz = date_default_timezone_get();
} }
$birthdate = self::convert($dob . ' 00:00:00+00:00', $owner_tz, 'UTC', 'Y-m-d'); $birthdate = DateTimeFormat::convert($dob . ' 00:00:00+00:00', $owner_tz, 'UTC', 'Y-m-d');
list($year, $month, $day) = explode("-", $birthdate); list($year, $month, $day) = explode("-", $birthdate);
$year_diff = self::timezoneNow($viewer_tz, 'Y') - $year; $year_diff = DateTimeFormat::timezoneNow($viewer_tz, 'Y') - $year;
$curr_month = self::timezoneNow($viewer_tz, 'm'); $curr_month = DateTimeFormat::timezoneNow($viewer_tz, 'm');
$curr_day = self::timezoneNow($viewer_tz, 'd'); $curr_day = DateTimeFormat::timezoneNow($viewer_tz, 'd');
if (($curr_month < $month) || (($curr_month == $month) && ($curr_day < $day))) { if (($curr_month < $month) || (($curr_month == $month) && ($curr_day < $day))) {
$year_diff--; $year_diff--;
@ -412,7 +412,7 @@ class Temporal
{ {
$d = sprintf('%04d-%02d-01 00:00', intval($y), intval($m)); $d = sprintf('%04d-%02d-01 00:00', intval($y), intval($m));
return self::utc($d, 'w'); return DateTimeFormat::utc($d, 'w');
} }
/** /**
@ -442,8 +442,8 @@ class Temporal
'October', 'November', 'December' 'October', 'November', 'December'
]; ];
$thisyear = self::localNow('Y'); $thisyear = DateTimeFormat::localNow('Y');
$thismonth = self::localNow('m'); $thismonth = DateTimeFormat::localNow('m');
if (!$y) { if (!$y) {
$y = $thisyear; $y = $thisyear;
} }
@ -460,7 +460,7 @@ class Temporal
$started = false; $started = false;
if (($y == $thisyear) && ($m == $thismonth)) { if (($y == $thisyear) && ($m == $thismonth)) {
$tddate = intval(self::localNow('j')); $tddate = intval(DateTimeFormat::localNow('j'));
} }
$str_month = day_translate($mtab[$m]); $str_month = day_translate($mtab[$m]);