Forum


Willkommen, Gast
Benutzername: Passwort: Angemeldet bleiben:

THEMA: Calendar module's idea of "today" is off by one in GMT+7.

Calendar module's idea of "today" is off by one in GMT+7. 3 Jahre 10 Monate ago #3908

  • user818
  • user818s Avatar
When looking at the calendar module in GMT+7, the highlight of today is off.

Just now, the calendar highlights the 6th of June as today, but it is the 7th here.

See attached screenshot for a view of current date at the top of the screen and a clip of the calendar.

This instance of the calendar is publicly visible at wefreedive.com/courses

Timezones have not been an issue in any other place on this server and joomla installation.
Anhang:
Der Administrator hat öffentliche Schreibrechte deaktiviert.

Calendar module's idea of "today" is off by one in GMT+7. 3 Jahre 10 Monate ago #3923

  • SigiK
  • Premium Mitglied
  • OSG Support
  • SigiKs Avatar
  • Offline
  • User-Bewertung: 99
Dear Richard,
thanks for your hint.
We will check it.
Sigrid
Your feedback on the extensions.joomla.org/extension/osg-seminar-manager-pro/ supports our work and the further development of our products.
Der Administrator hat öffentliche Schreibrechte deaktiviert.

Calendar module's idea of "today" is off by one in GMT+7. 3 Jahre 10 Monate ago #3931

  • liu
  • OSG Developer
  • lius Avatar
  • Offline
  • User-Bewertung: 50
Hello Richard, you're right, the highlighting of today is currently timezone independent, hence always today in UTC is highlighted in the calendar.

Here the quick fix which you can take in the current module:
in modules/mod_seminarman_calendar/tmpl/default.php add the following codes from the line 71 (before the "for" loop)
$config = JFactory::getConfig(); 
$offset = $config->get('offset'); 
$dt = new DateTime("now", new DateTimeZone($offset));
$cdate = $dt->format('d.m.Y, H:i:s');
$current_date = strtotime($cdate);  // current datetime in seconds in your timezone
Your feedback on the extensions.joomla.org/extension/osg-seminar-manager-pro/ supports our work and the further development of our products.
Der Administrator hat öffentliche Schreibrechte deaktiviert.

Calendar module's idea of "today" is off by one in GMT+7. 3 Jahre 10 Monate ago #3946

  • user818
  • user818s Avatar
Yep, that worked :)

Thank you so much for the quick fix! :)
Der Administrator hat öffentliche Schreibrechte deaktiviert.
© 2017 Open Source Groupe GmbH. Alle Rechte vorbehalten.
Cookies erleichtern die Bereitstellung unserer Dienste. Mit der Nutzung unserer Dienste erklären Sie sich damit einverstanden, dass wir Cookies verwenden.