DateTimeComputed::__construct

public DateTimeComputed::__construct(DataDefinitionInterface $definition, $name = NULL, TypedDataInterface $parent = NULL) Constructs a TypedData object given its definition and context. @todo When \Drupal\Core\Config\TypedConfigManager has been fixed to use class-based definitions, type-hint $definition to DataDefinitionInterface. https://www.drupal.org/node/1928868 Parameters \Drupal\Core\TypedData\DataDefinitionInterface $definition: The data definition. string $name: (optional) The name of

DateTimeComputed::setValue

public DateTimeComputed::setValue($value, $notify = TRUE) Sets the data value. Parameters mixed|null $value: The value to set in the format as documented for the data type or NULL to unset the data value. bool $notify: (optional) Whether to notify the parent object of the change. Defaults to TRUE. If a property is updated from a parent object, set it to FALSE to avoid being notified again. Throws \InvalidArgumentException If the value input is inappropriate. \Drupal\Core\TypedData\Exception\R

DateTimeComputed::getValue

public DateTimeComputed::getValue($langcode = NULL) Gets the data value. Return value mixed Overrides TypedData::getValue File core/modules/datetime/src/DateTimeComputed.php, line 38 Class DateTimeComputed A computed property for dates of date time field items. Namespace Drupal\datetime Code public function getValue($langcode = NULL) { if ($this->date !== NULL) { return $this->date; } $item = $this->getParent(); $value = $item->{($this->definition->getSe

DateTimeComputed::$date

Cached computed date. Type: \DateTime|null File core/modules/datetime/src/DateTimeComputed.php, line 23 Class DateTimeComputed A computed property for dates of date time field items. Namespace Drupal\datetime Code protected $date = NULL;

DateTimeComputed

A computed property for dates of date time field items. Required settings (below the definition's 'settings' key) are: date source: The date property containing the to be computed date. Hierarchy class \Drupal\Core\TypedData\TypedData implements PluginInspectionInterface, TypedDataInterface uses StringTranslationTrait, TypedDataTraitclass \Drupal\datetime\DateTimeComputed File core/modules/datetime/src/DateTimeComputed.php, line 16 Namespace Drupal\datetime Members Name Modifier

Datetime::valueCallback

public static Datetime::valueCallback(&$element, $input, FormStateInterface $form_state) Determines how user input is mapped to an element's #value property. Parameters array $element: An associative array containing the properties of the element. mixed $input: The incoming input to populate the form element. If this is FALSE, the element's default value should be returned. \Drupal\Core\Form\FormStateInterface $form_state: The current state of the form. Return value mixed The value to ass

Datetime::validateDatetime

public static Datetime::validateDatetime(&$element, FormStateInterface $form_state, &$complete_form) Validation callback for a datetime element. If the date is valid, the date object created from the user input is set in the form for use by the caller. The work of compiling the user input back into a date object is handled by the value callback, so we can use it here. We also have the raw input available for validation testing. Parameters array $element: The form element whose value is

Datetime::processDatetime

public static Datetime::processDatetime(&$element, FormStateInterface $form_state, &$complete_form) Expands a datetime element type into date and/or time elements. All form elements are designed to have sane defaults so any or all can be omitted. Both the date and time components are configurable so they can be output as HTML5 datetime elements or not, as desired. Examples of possible configurations include: HTML5 date and time: #date_date_element = 'date'; #date_time_element = 'time';

Datetime::getInfo

public Datetime::getInfo() Returns the element properties for this element. Return value array An array of element properties. See \Drupal\Core\Render\ElementInfoManagerInterface::getInfo() for documentation of the standard properties of all elements, and the return value format. Overrides ElementInterface::getInfo File core/lib/Drupal/Core/Datetime/Element/Datetime.php, line 25 Class Datetime Provides a datetime element. Namespace Drupal\Core\Datetime\Element Code public function get

Datetime::getHtml5TimeFormat

protected static Datetime::getHtml5TimeFormat($element) Retrieves the right format for a HTML5 time element. The format is important because these elements will not work with any other format. Parameters string $element: The $element to assess. Return value string Returns the right format for the time element, or the original format if this is not a HTML5 element. File core/lib/Drupal/Core/Datetime/Element/Datetime.php, line 419 Class Datetime Provides a datetime element. Namespace Dr