public static function hours($format = 'H',
$required = FALSE
) { $hours =
[];
if ($format == 'h' ||
$format == 'g'
) { $min = 1;
$max = 12;
} else { $min = 0;
$max = 23;
} for ($i =
$min;
$i <=
$max;
$i++
) { $formatted =
($format == 'H' ||
$format == 'h'
) ? DrupalDateTime::
datePad($i) :
$i;
$hours[$i] =
$formatted;
} $none =
['' => ''
];
return !
$required ?
$none +
$hours :
$hours;
} /**
* Constructs an array of minutes.
*
* @param string $format
* (optional) A date format string that indicates the format to use for the
* minutes. Defaults to 'i'.
* @param bool $required
* (optional) If FALSE, the returned array will include a blank value.
* Defaults to FALSE.
* @param int $increment
* An integer value to increment the values. Defaults to 1.
*
* @return array
* An array of minutes in the selected format.
*/