date¶
A control that can display and specify a formatted date, with or without time.
Properties¶
Name | Type | Default | Description |
---|---|---|---|
(★) |
dynamic(datetime) | The date that this control represents and can modify.
It is typically bound to a |
|
with_time |
bool | False | Whether or not to show the time part of the date. |
format |
str | The format to apply to the value. See below. |
|
editable |
dynamic(bool) | True | Shows the date as a formatted string if not editable. |
on_change |
Callback | The name of a function that is triggered when the value is updated.
|
|
propagate |
bool | App config | Allows the control's main value to be automatically propagated. |
(★)date
is the default property for this visual element.
Usage¶
Using the full date and time¶
Assuming a variable dt contains a Python datetime
object, you can create
a date selector that represents it:
Page content
<|{dt}|date|>
<taipy:date>{dt}</taipy:date>
Using only the date¶
If you don't need to use the date, you can do so:
Page content
<|{dt}|date|not with_time|>
<taipy:date with_time="false">{dt}</taipy:date>