Skip to content

Commit

Permalink
πŸ“(react) add a timezone management section to date picker docs
Browse files Browse the repository at this point in the history
Describe the current behavior of date picker components,
especially with the recent changes in component's API.
  • Loading branch information
lebaudantoine committed Jul 25, 2023
1 parent 28daba6 commit 739b8b9
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions packages/react/src/components/Forms/DatePicker/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,15 @@ By default, the DatePicker component uses the CunninghamProvider locale.
<Story id="components-forms-datepicker--cunningham-locale"/>
</Canvas>

## Timezone management

By default, the component uses the user's local timezone. When a timezone is passed, dates are selected at midnight in that specific timezone.
If a value or default value is provided, the component preserves the time unless the user clears the input.
When the input is cleared, the dates are reset to midnight in the current timezone.
The component accepts both UTC date-time strings and date-time strings with offsets from UTC.
However, it consistently returns the output in UTC time, ensuring uniformity across different timezone.


## Props

You can see the list of props below.
Expand Down

0 comments on commit 739b8b9

Please sign in to comment.