Skip to main content

DateTimeInput

This class provides a specialized input widget for handling date and time values within forms. It utilizes a specific template for rendering and relies on localized format patterns to ensure consistent data entry and validation.

Attributes

AttributeTypeDescription
format_keystring = DATETIME_INPUT_FORMATSThe key used to look up the datetime input formats in the active language's locale settings.
template_namestring = django/forms/widgets/datetime.htmlThe path to the HTML template used to render the datetime input widget.

Constructor

Signature

def DateTimeInput()

Signature

def DateTimeInput(
attrs: dict = null,
format: string = null
) - > null

Parameters

NameTypeDescription
attrsdict = nullA dictionary of HTML attributes to be added to the rendered input element.
formatstring = nullThe format string used to render the datetime value in the input field; if not provided, the default DATETIME_INPUT_FORMATS will be used.