Skip to content

Commit

Permalink
server side placeholder default
Browse files Browse the repository at this point in the history
  • Loading branch information
dgodinez-dh committed Aug 19, 2024
1 parent 4fd4365 commit 910d544
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion plugins/ui/DESIGN.md
Original file line number Diff line number Diff line change
Expand Up @@ -1361,7 +1361,7 @@ ui.date_picker(

| Parameter | Type | Description |
| ------------------- | -------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --- |
| `placeholder_value` | `Date \| None` | A placeholder date that influences the format of the placeholder shown when no value is selected. Defaults to today at midnight on the local machine time zone. |
| `placeholder_value` | `Date \| None` | A placeholder date that influences the format of the placeholder shown when no value is selected. Defaults to today at the current time on the server machine time zone. |
| `value` | `Date \| None` | The current value (controlled). |
| `default_value` | `Date \| None` | The default value (uncontrolled). |
| `min_value` | `Date \| None` | The minimum allowed date that a user may select. |
Expand Down
2 changes: 1 addition & 1 deletion plugins/ui/docs/components/date_picker.md
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ dp = ui.date_picker(
## Uncontrolled mode with placeholder_value

If both `value` and `default_value` are omitted, the date_picker will be in uncontrolled mode displaying no date selected. When opened, the date picker will suggest the date from the `placeholder_value` prop.
Omitting `placeholder_value` will default it to today at midnight on the local machine time zone.
Omitting `placeholder_value` will default it to today at the current time on the server machine time zone.

```python
from deephaven import ui
Expand Down
3 changes: 2 additions & 1 deletion plugins/ui/src/deephaven/ui/components/date_picker.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
from ..types import Date, Granularity
from .basic import component_element
from .make_component import make_component
from deephaven.time import dh_now

DatePickerElement = Element

Expand Down Expand Up @@ -76,7 +77,7 @@ def _convert_date_picker_props(

@make_component
def date_picker(
placeholder_value: Date | None = None,
placeholder_value: Date | None = dh_now(),
value: Date | None = None,
default_value: Date | None = None,
min_value: Date | None = None,
Expand Down

0 comments on commit 910d544

Please sign in to comment.