You are here

function social_event_date_is_all_day in Open Social 8.4

Same name and namespace in other branches
  1. 8.9 modules/social_features/social_event/social_event.module \social_event_date_is_all_day()
  2. 8.3 modules/social_features/social_event/social_event.module \social_event_date_is_all_day()
  3. 8.5 modules/social_features/social_event/social_event.module \social_event_date_is_all_day()
  4. 8.6 modules/social_features/social_event/social_event.module \social_event_date_is_all_day()
  5. 8.7 modules/social_features/social_event/social_event.module \social_event_date_is_all_day()
  6. 8.8 modules/social_features/social_event/social_event.module \social_event_date_is_all_day()
  7. 10.3.x modules/social_features/social_event/social_event.module \social_event_date_is_all_day()
  8. 10.0.x modules/social_features/social_event/social_event.module \social_event_date_is_all_day()
  9. 10.1.x modules/social_features/social_event/social_event.module \social_event_date_is_all_day()
  10. 10.2.x modules/social_features/social_event/social_event.module \social_event_date_is_all_day()

Check if event date is all day.

2 calls to social_event_date_is_all_day()
social_event_date_all_day_checkbox in modules/social_features/social_event/social_event.module
Add 'All day' checkbox to event datetime field.
social_event_form_alter in modules/social_features/social_event/social_event.module
Implements hook_form_alter().

File

modules/social_features/social_event/social_event.module, line 488
The Social event module.

Code

function social_event_date_is_all_day(DrupalDateTime $date) {
  $zone = !empty($date
    ->getTimezone()) ? $date
    ->getTimezone()
    ->getName() : DateTimeItemInterface::STORAGE_TIMEZONE;
  return $date
    ->format('H:i', [
    'timezone' => $zone,
  ]) == '00:01';
}