1
1
Fork 0

Add Temporal::local() shorthand for Temporal::convert()

This commit is contained in:
Hypolite Petovan 2018-01-26 19:29:06 -05:00
commit 0bee706e51
11 changed files with 48 additions and 36 deletions

View file

@ -206,8 +206,8 @@ function cal_content(App $a)
$start = Temporal::utc($start);
$finish = Temporal::utc($finish);
$adjust_start = Temporal::convert($start, date_default_timezone_get());
$adjust_finish = Temporal::convert($finish, date_default_timezone_get());
$adjust_start = Temporal::local($start);
$adjust_finish = Temporal::local($finish);
// put the event parametes in an array so we can better transmit them
$event_params = [
@ -231,7 +231,7 @@ function cal_content(App $a)
if (DBM::is_result($r)) {
$r = sort_by_date($r);
foreach ($r as $rr) {
$j = $rr['adjust'] ? Temporal::convert($rr['start'], date_default_timezone_get(), 'UTC', 'j') : Temporal::utc($rr['start'], 'j');
$j = $rr['adjust'] ? Temporal::local($rr['start'], 'j') : Temporal::utc($rr['start'], 'j');
if (!x($links, $j)) {
$links[$j] = System::baseUrl() . '/' . $a->cmd . '#link-' . $j;
}