6 * Contains methods for common data conversions.
8 class CommonDataConverter {
11 * Provides a passthrough to place unformatted values in content attributes.
14 * The data to be placed in the content attribute.
19 public static function rawValue($data) {
24 * Converts a date entity field array into an ISO 8601 timestamp string.
27 * The array containing the 'value' element.
30 * Returns the ISO 8601 timestamp.
32 public static function dateIso8601Value($data) {
33 return \Drupal::service('date.formatter')->format($data['value'], 'custom', 'c', 'UTC');