Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DateTime component: Add additional design documentation and image #16757

Merged
merged 4 commits into from
Aug 1, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion packages/components/src/date-time/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,14 @@
# DateTimePicker

DateTimePicker is a React component to render a calendar and clock for selecting a date and time. The calendar and clock components can be accessed individually using the `DatePicker` and `TimePicker` components respectively.
DateTimePicker is a React component that renders a calendar and clock for date and time selection. The calendar and clock components can be accessed individually using the `DatePicker` and `TimePicker` components respectively.

![Date Time component](https://wordpress.org/gutenberg/files/2019/07/date-time-picker.png)

## Best practices

Date pickers should:

- Use smart defaults and highlight the current date.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Isn't this a behavior that is already absorbed by the component itself? Is it worth adding to the docs? A user might ask "how do I do that" since it's mentioned in the "best practices"?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see where you're coming from. The idea behind documenting this is to help define the best practices for a component like this in terms of functionality. I think it's useful in case folks in the future want to make an update to this component that might affect this functionality as well as a precedent in case future folks want to make a new component that has similar functionality.


## Usage

Expand Down