You are here

function scheduler_update_8001 in Scheduler 8

Same name and namespace in other branches
  1. 2.x scheduler.install \scheduler_update_8001()

Reset date and time formats to default.

File

./scheduler.install, line 92
Installation file for Scheduler module.

Code

function scheduler_update_8001() {

  // See https://www.drupal.org/project/scheduler/issues/2799869
  $config = \Drupal::configFactory()
    ->getEditable('scheduler.settings');
  $config
    ->set('date_format', 'Y-m-d H:i:s')
    ->set('date_only_format', 'Y-m-d')
    ->set('time_only_format', 'H:i:s')
    ->save();
  return t('The date and time format has been reset.');
}