DynamicDate

class widgets.DynamicDate(date: datetime | date | time, style: int = 0, color: Color = None, font: Font = None, background_color: Color = None, corner_radius: float = 0.0, padding: Padding = None, link: str = None)

A text displaying a date with the correct format.

As widgets are not dynamic and UI elements aren’t modifiable after being displayed, this class can also serve to display timers with a provided date.

Example:

date

The date used to create the text.

Valid value types:

  • datetime.datetime: A specific date and time.

  • datetime.date: A date without specifying time. The current time will be used.

  • datetime.time: A time without specifying date. The current date will be used.

Return type:

Union[datetime.datetime, datetime.date, datetime.time]

style

The date style determines how the date should be used to create text.

See DateStyle.

Return type:

DateStyle

font

The font of the text.

Return type:

Font

color

The foreground color of the text.

Return type:

Color