1 system.module system_date_format_delete($date_format_name)

Deletes a date format from the database.

Parameters

$date_format_name: The date format ID.

File

core/modules/system/system.module, line 3884
Configuration system that lets administrators modify the workings of the site.

Code

function system_date_format_delete($date_format_name) {
  // Do not allow deletion of module-provided formats.
  $format = system_get_date_formats($date_format_name);
  if (isset($format['module'])) {
    return FALSE;
  }

  $format_id = 'formats.' . $date_format_name;
  config('system.date')->clear($format_id)->save();
  backdrop_static_reset('system_get_date_formats');
}