Function __global->_form_input_date

Definitions

sources/form_templates.php

  • Get the Tempcode for a date input, raw.
  • Visibility: public
  • Is abstract?: No
  • Is static?: No
  • Is final?: No
  • Returns: object

Parameters

Name Type Passed by reference? Variadic? Default Set Range Description
$name ID_TEXT No No required parameter N/A N/A The parameter name for this input field
$required boolean No No required parameter N/A N/A Whether this is a required field
$null_default boolean No No required parameter N/A N/A Whether this field is empty by default
$do_time boolean No No required parameter N/A N/A Whether to input time for this field also
$default_time ?mixed No No Null N/A N/A The default timestamp to use (either TIME or array of time components) (null: none) [ignored if $null_default is set]
$total_years_to_show ?integer No No 10 N/A N/A The number of years to allow selection from (pass a negative number for selection of past years instead of future years) (null: no limit)
$year_start ?integer No No Null N/A N/A The year to start counting $total_years_to_show from (null: if $total_years_to_show<0 then this year minus $total_years_to_show else if $total_years_to_show is not null then the current year else no restriction)
$tabindex ?integer No No Null N/A N/A The tab index of the field (null: not specified)
$do_date boolean No No True N/A N/A Whether to input date for this field (if false, will just do time)
$timezone ?ID_TEXT No No Null N/A N/A Timezone to input in (null: current user's timezone)
$handle_timezone boolean No No True N/A N/A Convert $default_time to $timezone
$autocomplete ~?mixed No No Null N/A N/A The autocomplete field name. (false: explicitly disable autocomplete) (null: no autocomplete attribute unless there's a default for this $name)
$read_only boolean No No False N/A N/A Whether this field should be disabled

Returns

  • The input field
  • Type: Tempcode
  • Set: N/A
  • Range: N/A

Preview

Code (PHP)

/**
 * Get the Tempcode for a date input, raw.
 *
 * @param  ID_TEXT $name The parameter name for this input field
 * @param  boolean $required Whether this is a required field
 * @param  boolean $null_default Whether this field is empty by default
 * @param  boolean $do_time Whether to input time for this field also
 * @param  ?mixed $default_time The default timestamp to use (either TIME or array of time components) (null: none) [ignored if $null_default is set]
 * @param  ?integer $total_years_to_show The number of years to allow selection from (pass a negative number for selection of past years instead of future years) (null: no limit)
 * @param  ?integer $year_start The year to start counting $total_years_to_show from (null: if $total_years_to_show<0 then this year minus $total_years_to_show else if $total_years_to_show is not null then the current year else no restriction)
 * @param  ?integer $tabindex The tab index of the field (null: not specified)
 * @param  boolean $do_date Whether to input date for this field (if false, will just do time)
 * @param  ?ID_TEXT $timezone Timezone to input in (null: current user's timezone)
 * @param  boolean $handle_timezone Convert $default_time to $timezone
 * @param  ~?mixed $autocomplete The autocomplete field name. (false: explicitly disable autocomplete) (null: no autocomplete attribute unless there's a default for this $name)
 * @param  boolean $read_only Whether this field should be disabled
 * @return Tempcode The input field
 */

function _form_input_date(string $name, bool $required, bool $null_default, bool $do_time, $default_time = null, ?int $total_years_to_show = 10, ?int $year_start = null, ?int $tabindex = null, bool $do_date = true, ?string $timezone = null, bool $handle_timezone = true, $autocomplete = null, bool $read_only = false) : object