Skip to content

DateEntry

This widget is composed of two widgets, the Entry widget and the Button widget. The Entry component behaves identically to the default entry widget, and the calendar button behaves as the default solid button.

The DatePickerPopup is invoked when the calendar button is pressed. The default color applied to the popup is primary.

This widget also supports special styles for disabled state, readonly state, and invalid state.

date entries

# default date entry
DateEntry()

# success colored date entry
DateEntry(bootstyle="success")

Other date entry styles

Disabled date entry

This style cannot be applied via keywords; it is configured through widget settings.

# create the date entry in a disabled state
DateEntry(state="disabled")

# disable a date entry after creation
d = DateEntry()
d.configure(state="disabled")

Readonly date entry

This style cannot be applied via keywords; it is configured through widget settings.

# create the date entry in a readonly state
DateEntry(state="readonly")

# set the date entry readonly state after creation
d = DateEntry()
d.configure(state="readonly")

Invalid date entry

This style cannot be applied via keywords, but rather is the result of a validation process implemented on the widget. In the Cookbook you will find an example of how to apply validation to an Entry based widget.