qubeshub / hubzero-cms

HubZero CMS code base for QUBESHub.
https://qubeshub.org
GNU General Public License v2.0
0 stars 1 forks source link

Group event plugin is not showing timezone information correctly... #322

Open mdlama opened 3 months ago

mdlama commented 3 months ago

...in particular when the setting "Ignore daylight savings time" is selected. You can see it in action here:

https://qubeshub.org/community/groups/ocelots/events/past

Search the page for "Workshop: Turn your research in tropical biology into engaging online learning modules with OCELOTS"

mdlama commented 3 months ago

Actually not sure what this is supposed to do.

mdlama commented 2 months ago

I should also add that the user's timezone is not working. It seems to be always showing EDT.

mdlama commented 2 months ago

See https://qubeshub.org/support/ticket/1169

mdlama commented 2 months ago

See https://qubeshub.org/support/ticket/1673 (should have worked to pull from user timezone, but not working right now)

mdlama commented 2 months ago

Found it. Previous dev created a userLocalizer helper file that was supposed to get user timezone but wasn't working: core/plugins/groups/calendar/helpers/userLocalizer.php.

The code was using User::get('params'), but for some reason that is ignoring the jos_user database. The following code works in the userLocalizer.php file:

protected function _getUserTimezone()
{
    $member = Member::oneOrFail(User::get('id'));
    return $member->params->get('timezone') ? $member->params->get('timezone') : $this->systemTimezone;
}

For Member to work, need to have use Components\Members\Models\Member;