public static function SmartDateTrait::loadSmartDateFormat in Smart Date 3.4.x
Same name and namespace in other branches
- 8.2 src/SmartDateTrait.php \Drupal\smart_date\SmartDateTrait::loadSmartDateFormat()
- 8 src/SmartDateTrait.php \Drupal\smart_date\SmartDateTrait::loadSmartDateFormat()
- 3.x src/SmartDateTrait.php \Drupal\smart_date\SmartDateTrait::loadSmartDateFormat()
- 3.0.x src/SmartDateTrait.php \Drupal\smart_date\SmartDateTrait::loadSmartDateFormat()
- 3.1.x src/SmartDateTrait.php \Drupal\smart_date\SmartDateTrait::loadSmartDateFormat()
- 3.2.x src/SmartDateTrait.php \Drupal\smart_date\SmartDateTrait::loadSmartDateFormat()
- 3.3.x src/SmartDateTrait.php \Drupal\smart_date\SmartDateTrait::loadSmartDateFormat()
Load a Smart Date Format from a format name.
Parameters
string $formatName: The machine name of a Smart Date Format.
Return value
null|array An array of the format's options.
2 calls to SmartDateTrait::loadSmartDateFormat()
- SmartDateProcessor::process in src/
Plugin/ FullcalendarViewProcessor/ SmartDateProcessor.php - Process retrieved values before being passed to Fullcalendar.
- SmartDateTrait::formatSmartDate in src/
SmartDateTrait.php - Creates a formatted date value as a string.
File
- src/
SmartDateTrait.php, line 447
Class
- SmartDateTrait
- Provides friendly methods for smart date range.
Namespace
Drupal\smart_dateCode
public static function loadSmartDateFormat($formatName) {
$format = NULL;
$loadedFormat = \Drupal::entityTypeManager()
->getStorage('smart_date_format')
->load($formatName);
if ($loadedFormat instanceof SmartDateFormatInterface) {
$format = $loadedFormat
->getOptions();
}
return $format;
}