Loading office_hours.api.php +7 −3 Original line number Diff line number Diff line Loading @@ -22,7 +22,7 @@ use Drupal\Core\Entity\EntityInterface; * @see issue [#1925272] Handle timezone. */ function hook_office_hours_current_time_alter(int &$time, EntityInterface $entity) { // Add user timezone to time. // Update the 'current time' to calculate current, open, office hours. // Assume that all owned entities (for example, offices) should // depend on user timezone. Loading @@ -31,8 +31,12 @@ function hook_office_hours_current_time_alter(int &$time, EntityInterface $entit // Client sets his timezone in his account data. // His articles (offices) have office hours with current status (open\closed). // Client sets it to e.g., 8:00-20:00. // Visitor chooses his city and wants to see if offices in this city are open. // Visitor has not maintained a timezone. // Visitor chooses his city (in a Views' filter) // and wants to see if offices in this city are open. // Each city has a timezone attached. // // Adjust content time to content owner's timezone. if ($entity instanceof \Drupal\user\EntityOwnerInterface && ($account = $entity->getOwner()) && ($account->isAuthenticated()) Loading Loading
office_hours.api.php +7 −3 Original line number Diff line number Diff line Loading @@ -22,7 +22,7 @@ use Drupal\Core\Entity\EntityInterface; * @see issue [#1925272] Handle timezone. */ function hook_office_hours_current_time_alter(int &$time, EntityInterface $entity) { // Add user timezone to time. // Update the 'current time' to calculate current, open, office hours. // Assume that all owned entities (for example, offices) should // depend on user timezone. Loading @@ -31,8 +31,12 @@ function hook_office_hours_current_time_alter(int &$time, EntityInterface $entit // Client sets his timezone in his account data. // His articles (offices) have office hours with current status (open\closed). // Client sets it to e.g., 8:00-20:00. // Visitor chooses his city and wants to see if offices in this city are open. // Visitor has not maintained a timezone. // Visitor chooses his city (in a Views' filter) // and wants to see if offices in this city are open. // Each city has a timezone attached. // // Adjust content time to content owner's timezone. if ($entity instanceof \Drupal\user\EntityOwnerInterface && ($account = $entity->getOwner()) && ($account->isAuthenticated()) Loading