You are here

function smart_date_update_8301 in Smart Date 3.4.x

Same name and namespace in other branches
  1. 3.0.x smart_date.install \smart_date_update_8301()
  2. 3.1.x smart_date.install \smart_date_update_8301()
  3. 3.2.x smart_date.install \smart_date_update_8301()
  4. 3.3.x smart_date.install \smart_date_update_8301()

Set site_time_toggle value on Smart Date Formats to match previous behaviour.

File

./smart_date.install, line 99

Code

function smart_date_update_8301() {
  $format_storage = \Drupal::entityTypeManager()
    ->getStorage('smart_date_format');
  $formats = $format_storage
    ->loadMultiple(NULL);
  foreach ($formats as $format) {
    $format
      ->set('site_time_toggle', 1);
    $format
      ->save();
  }
}