Skip to content

Commit

Permalink
Merge pull request #137 from ihackcode/develop
Browse files Browse the repository at this point in the history
more timezone conversion
  • Loading branch information
mambax7 authored Jul 4, 2020
2 parents 5e9b241 + c317854 commit baf0804
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion class/Form/ItemForm.php
Original file line number Diff line number Diff line change
Expand Up @@ -147,9 +147,11 @@ public function createElements($obj)
if (!\is_object($GLOBALS['xoopsUser'])) {
$group = [XOOPS_GROUP_ANONYMOUS];
$currentUid = 0;
$timeoffset = 0;
} else {
$group = $GLOBALS['xoopsUser']->getGroups();
$currentUid = $GLOBALS['xoopsUser']->uid();
$timeoffset = $GLOBALS['xoopsUser']->getVar('timezone_offset');
}

$this->setExtra('enctype="multipart/form-data"');
Expand Down Expand Up @@ -359,7 +361,7 @@ public function createElements($obj)
}

$dateExpireYesNo = new \XoopsFormRadioYN('', 'use_expire_yn', $dateexpire_opt);
$dateexpire = \strtotime(\formatTimestamp($dateexpire)); //set to user timezone
$dateexpire = formatTimestamp($dateexpire, 'U', $timeoffset);
$dateexpire_datetime = new \XoopsFormDateTime('', 'dateexpire', $size = 15, $dateexpire, true);
if (0 == $dateexpire_opt) {
$dateexpire_datetime->setExtra('disabled="disabled"');
Expand Down

0 comments on commit baf0804

Please sign in to comment.