public static function SmartDateTrait::settingsFormatNoTz in Smart Date 3.1.x
Same name and namespace in other branches
- 3.2.x src/SmartDateTrait.php \Drupal\smart_date\SmartDateTrait::settingsFormatNoTz()
- 3.3.x src/SmartDateTrait.php \Drupal\smart_date\SmartDateTrait::settingsFormatNoTz()
- 3.4.x src/SmartDateTrait.php \Drupal\smart_date\SmartDateTrait::settingsFormatNoTz()
Removes timezone tokens from time settings.
Parameters
array $settings: The formatter settings.
Return value
array The settings with timezone output stripped.
File
- src/
SmartDateTrait.php, line 300
Class
- SmartDateTrait
- Provides friendly methods for smart date range.
Namespace
Drupal\smart_dateCode
public static function settingsFormatNoTz(array $settings = []) {
if (isset($settings['time_format'])) {
$settings['time_format'] = preg_replace('/\\s*(?<![\\\\])[eOPTZ]/i', '', $settings['time_format']);
}
if (isset($settings['time_hour_format'])) {
$settings['time_hour_format'] = preg_replace('/\\s*(?<![\\\\])[eOPTZ]/i', '', $settings['time_hour_format']);
}
return $settings;
}