From 910d544232a945321e4762292aeb7d29311d1da7 Mon Sep 17 00:00:00 2001 From: David Godinez Date: Mon, 19 Aug 2024 10:34:48 -0600 Subject: [PATCH] server side placeholder default --- plugins/ui/DESIGN.md | 2 +- plugins/ui/docs/components/date_picker.md | 2 +- plugins/ui/src/deephaven/ui/components/date_picker.py | 3 ++- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/plugins/ui/DESIGN.md b/plugins/ui/DESIGN.md index 28e381fde..9c6d4986b 100644 --- a/plugins/ui/DESIGN.md +++ b/plugins/ui/DESIGN.md @@ -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. | diff --git a/plugins/ui/docs/components/date_picker.md b/plugins/ui/docs/components/date_picker.md index 935ab49ad..017e81acc 100644 --- a/plugins/ui/docs/components/date_picker.md +++ b/plugins/ui/docs/components/date_picker.md @@ -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 diff --git a/plugins/ui/src/deephaven/ui/components/date_picker.py b/plugins/ui/src/deephaven/ui/components/date_picker.py index 6126f3f55..fba8aa4d6 100644 --- a/plugins/ui/src/deephaven/ui/components/date_picker.py +++ b/plugins/ui/src/deephaven/ui/components/date_picker.py @@ -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 @@ -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,