Datelist::processDatelist

public static Datelist::processDatelist(&$element, FormStateInterface $form_state, &$complete_form) Expands a date element into an array of individual elements. Required settings: #default_value: A DrupalDateTime object, adjusted to the proper local timezone. Converting a date stored in the database from UTC to the local zone and converting it back to UTC before storing it is not handled here. This element accepts a date as the default value, and then converts the user input strings ba

Datelist::incrementRound

protected static Datelist::incrementRound(&$date, $increment) Rounds minutes and seconds to nearest requested value. Parameters $date: $increment: File core/lib/Drupal/Core/Datetime/Element/Datelist.php, line 365 Class Datelist Provides a datelist element. Namespace Drupal\Core\Datetime\Element Code protected static function incrementRound(&$date, $increment) { // Round minutes and seconds, if necessary. if ($date instanceof DrupalDateTime && $increment > 1) {

Datelist::getInfo

public Datelist::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/Datelist.php, line 20 Class Datelist Provides a datelist element. Namespace Drupal\Core\Datetime\Element Code public function get

Datelist::checkEmptyInputs

protected static Datelist::checkEmptyInputs($input, $parts) Checks the input array for empty values. Input array keys are checked against values in the parts array. Elements not in the parts array are ignored. Returns an array representing elements from the input array that have no value. If no empty values are found, returned array is empty. Parameters array $input: Array of individual inputs to check for value. array $parts: Array to check input against, ignoring elements not in this array.

Datelist

Provides a datelist element. Plugin annotation @FormElement("datelist") Hierarchy class \Drupal\Component\Plugin\PluginBase implements DerivativeInspectionInterface, PluginInspectionInterfaceclass \Drupal\Core\Plugin\PluginBase uses DependencySerializationTrait, StringTranslationTraitclass \Drupal\Core\Render\Element\RenderElement implements ElementInterfaceclass \Drupal\Core\Render\Element\FormElement implements FormElementInterfaceclass \Drupal\Core\Datetime\Element\DateElementBaseclass \Dru

DateHelper::years

public static DateHelper::years($min = 0, $max = 0, $required = FALSE) Constructs an array of years in a specified range. Parameters int $min: (optional) The minimum year in the array. Defaults to zero. int $max: (optional) The maximum year in the array. Defaults to zero. bool $required: (optional) If FALSE, the returned array will include a blank value. Defaults to FALSE. Return value array An array of years in the selected range. File core/lib/Drupal/Core/Datetime/DateHelper.php, line 291

DateHelper::weekDaysUntranslated

public static DateHelper::weekDaysUntranslated() Constructs an untranslated array of week days. Return value array An array of week day names File core/lib/Drupal/Core/Datetime/DateHelper.php, line 139 Class DateHelper Defines Gregorian Calendar date values. Namespace Drupal\Core\Datetime Code public static function weekDaysUntranslated() { return array( 'Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday', ); }

DateHelper::weekDaysOrdered

public static DateHelper::weekDaysOrdered($weekdays) Reorders weekdays to match the first day of the week. Parameters array $weekdays: An array of weekdays. Return value array An array of weekdays reordered to match the first day of the week. The keys will remain unchanged. For example, if the first day of the week is set to be Monday, the array keys will be [1, 2, 3, 4, 5, 6, 0]. File core/lib/Drupal/Core/Datetime/DateHelper.php, line 258 Class DateHelper Defines Gregorian Calendar date

DateHelper::weekDaysAbbr2

public static DateHelper::weekDaysAbbr2($required = FALSE) Constructs a translated array of 2-letter week day abbreviations. Parameters bool $required: (optional) If FALSE, the returned array will include a blank value. Defaults to FALSE. Return value array An array of week day 2 letter abbreviations File core/lib/Drupal/Core/Datetime/DateHelper.php, line 209 Class DateHelper Defines Gregorian Calendar date values. Namespace Drupal\Core\Datetime Code public static function weekDaysAb

DateHelper::weekDaysAbbr1

public static DateHelper::weekDaysAbbr1($required = FALSE) Constructs a translated array of 1-letter week day abbreviations. Parameters bool $required: (optional) If FALSE, the returned array will include a blank value. Defaults to FALSE. Return value array An array of week day 1 letter abbreviations File core/lib/Drupal/Core/Datetime/DateHelper.php, line 233 Class DateHelper Defines Gregorian Calendar date values. Namespace Drupal\Core\Datetime Code public static function weekDaysAb