Add Temporal::utc() shorthand to Temporal::convert()

This commit is contained in:
Hypolite Petovan 2018-01-26 07:29:32 -05:00
parent ca8209a2ce
commit 35d06bd9eb
22 changed files with 173 additions and 128 deletions

View file

@ -437,14 +437,14 @@ function list_post_dates($uid, $wall) {
$dyear = intval(substr($dnow, 0, 4));
$dstart = substr($dnow, 0, 8) . '01';
$dend = substr($dnow, 0, 8) . get_dim(intval($dnow), intval(substr($dnow, 5)));
$start_month = Temporal::convert($dstart, 'UTC', 'UTC', 'Y-m-d');
$end_month = Temporal::convert($dend, 'UTC', 'UTC', 'Y-m-d');
$str = day_translate(Temporal::convert($dnow, 'UTC', 'UTC', 'F'));
$start_month = Temporal::utc($dstart, 'Y-m-d');
$end_month = Temporal::utc($dend, 'Y-m-d');
$str = day_translate(Temporal::utc($dnow, 'F'));
if (!$ret[$dyear]) {
$ret[$dyear] = [];
}
$ret[$dyear][] = [$str, $end_month, $start_month];
$dnow = Temporal::convert($dnow . ' -1 month', 'UTC', 'UTC', 'Y-m-d');
$dnow = Temporal::utc($dnow . ' -1 month', 'Y-m-d');
}
return $ret;
}