Skip to content

Commit

Permalink
Prevent timezone difference to be applied twice (#24473)
Browse files Browse the repository at this point in the history
  • Loading branch information
infograf768 authored and HLeithner committed Apr 22, 2019
1 parent cce19e5 commit 314c3bc
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 53 deletions.
28 changes: 0 additions & 28 deletions administrator/components/com_fields/models/field.php
Original file line number Diff line number Diff line change
Expand Up @@ -343,34 +343,6 @@ public function getItem($pk = null)

$db->setQuery($query);
$result->assigned_cat_ids = $db->loadColumn() ?: array(0);

// Convert the created and modified dates to local user time for
// display in the form.
$tz = new DateTimeZone(JFactory::getApplication()->get('offset'));

if ((int) $result->created_time)
{
$date = new JDate($result->created_time);
$date->setTimezone($tz);

$result->created_time = $date->toSql(true);
}
else
{
$result->created_time = null;
}

if ((int) $result->modified_time)
{
$date = new JDate($result->modified_time);
$date->setTimezone($tz);

$result->modified_time = $date->toSql(true);
}
else
{
$result->modified_time = null;
}
}

return $result;
Expand Down
25 changes: 0 additions & 25 deletions administrator/components/com_fields/models/group.php
Original file line number Diff line number Diff line change
Expand Up @@ -325,31 +325,6 @@ public function getItem($pk = null)
{
$item->params = new Registry($item->params);
}

// Convert the created and modified dates to local user time for display in the form.
$tz = new DateTimeZone(JFactory::getApplication()->get('offset'));

if ((int) $item->created)
{
$date = new JDate($item->created);
$date->setTimezone($tz);
$item->created = $date->toSql(true);
}
else
{
$item->created = null;
}

if ((int) $item->modified)
{
$date = new JDate($item->modified);
$date->setTimezone($tz);
$item->modified = $date->toSql(true);
}
else
{
$item->modified = null;
}
}

return $item;
Expand Down

0 comments on commit 314c3bc

Please sign in to comment.