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. |
|
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.
Styling¶
All the date controls are generated with the "taipy-date" CSS class. You can use this class name to select the date selectors on your page and apply style.
Stylekit support¶
The Stylekit provides a specific class that you can use to style date selectors:
- fullwidth
If a date selector uses the fullwidth class, then it uses the whole available horizontal space.
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>