Skip to main content

DateRangeField

This class provides a specialized form field for inputting a range of dates. It utilizes a base date field and maps the input data to a date range object, ensuring that both the start and end values are valid dates.

Attributes

AttributeTypeDescription
default_error_messagesdict = {"invalid": _("Enter two valid dates.")}A dictionary containing the error message displayed when the input does not consist of two valid dates.
base_field[Field](../../../../forms/fields/field.md?sid=django_forms_fields_field) = forms.DateFieldThe form field class used to validate each individual endpoint of the date range.
range_typeclass = DateRangeThe underlying Python object type used to represent the continuous range of dates.

Constructor

Signature

def DateRangeField() - > null

Signature

def DateRangeField() - > null