Skip to main content

DateTimeRangeField

This class provides a form field for inputting a range of date and time values, including time zone information. It utilizes a base field of DateTimeField and validates that the input consists of two valid date/time entries. The class maps the resulting data to a DateTimeTZRange object for handling temporal intervals.

Attributes

AttributeTypeDescription
default_error_messagesdict = {"invalid": _("Enter two valid date/times.")}A dictionary containing the error message displayed when the input does not consist of two valid date/times.
base_field[Field](../../../../forms/fields/field.md?sid=django_forms_fields_field) = forms.DateTimeFieldThe form field class used to validate and render the individual start and end components of the date-time range.
range_typetype = DateTimeTZRangeThe underlying Python data type used to represent the continuous range of date-time objects.

Constructor

Signature

def DateTimeRangeField() - > null

Signature

def DateTimeRangeField() - > null