-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
[docs] refactor datetime docs to focus on React usage #2596
Conversation
refactor datetime docsPreview: documentation | landing | table |
<DateRangeInput | ||
formatDate={date => date.toLocaleString()} | ||
onChange={this.handleRangeChange} | ||
parseDate={str => new Date(str)} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
added required props for #2542
timezone docsPreview: documentation | landing | table |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Content and grammar looks good, only thing is jargon like "prop" should be avoided.
@@ -51,11 +48,17 @@ function getMomentFormatter(format: string): IDateFormatProps { | |||
<DateInput {...getMomentFormatter("LL")} locale="de" /> | |||
``` | |||
|
|||
@## Props |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Write out the word "properties" for professionalism.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"props" is actually a react convention, and they're never called "properties" (to distinguish from JS objects)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
see React's own docs: https://reactjs.org/docs/components-and-props.html
|
||
@## JavaScript API | ||
You can control the selected date by setting the `value` prop, or use the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
prop -> property
|
||
You can use the `modifiers` prop to conditionally apply styles to days. Modifiers are documented in | ||
full in the [**react-day-picker** documentation](http://react-day-picker.js.org/docs/matching-days). | ||
You can use the `modifiers` prop to conditionally apply styles to days. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
prop -> property
full in the [**react-day-picker** documentation](http://react-day-picker.js.org/docs/matching-days). | ||
You can use the `modifiers` prop to conditionally apply styles to days. | ||
Modifiers are a react-day-picker concept and are documented in full in the | ||
[**react-day-picker** documentation](http://react-day-picker.js.org/docs/matching-days). | ||
|
||
The example below creates a `DatePicker` that prevents the user from selecting any Sundays, | ||
by using the component in controlled mode and with the `modifiers` prop: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
prop -> property
@@ -71,3 +50,16 @@ function isSunday(date: Date) { | |||
return date.getDay() === 0; | |||
} | |||
``` | |||
|
|||
@## Props |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Props -> properties
`defaultValue`. (If `defaultValue` is not set, the current date and time is used | ||
as the default.) | ||
|
||
You can pass props to the inner `DatePicker` and `TimePicker` components using |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
prop -> property
@reactExample TimePickerExample | ||
|
||
@## JavaScript API | ||
@## Props |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
prop -> property
@## JavaScript API | ||
@## Props | ||
|
||
Use the `onChange` prop to listen for changes to the set time. You can control the selected time by |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
prop -> property
@## Props | ||
|
||
Use the `onChange` prop to listen for changes to the set time. You can control the selected time by | ||
setting the `value` prop, or use the component in uncontrolled mode and specify an initial time by |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
prop -> property
@@ -7,7 +7,7 @@ timezone metadata. | |||
|
|||
@reactExample TimezonePickerExample | |||
|
|||
@## JavaScript API | |||
@## Props |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
prop -> property
* Button: collapse css examples * Callout + intent docs * Progress bar * Skeleton, Spinner , Table * add new buttons example * breadcrumbs docs * button groups docs * card docs * collapse docs * collapsible list docs * editable text docs * more collapsible list * more card * remove button group code block * comments * navbar docs * hotkeys docs * icon docs * menu docs * alert docs * fix collapsible separators * context menu docs * dialog docs * editable text fixes * label docs * navbar docs * non ideal state docs * add props heading to overflow list * overlay docs * popover docs * portal docs * tabs docs * tag docs * text docs * toast docs * tooltip docs * tree docs * context menu usage * wrong tick * CSS -> Style * move portal props down * tabs props * text update * merge minimal tag CSS docs * card polish * CollapsibleList polish * EditableText polish * Icon polish * Menu polish * Spinner polish * Navbar polish * NIS polish * Progress Bar, Table HTML, Tag, Tree polish * Spinner polish (remove CSS) * Tabs polish * all Overlays polish * singular component page titles * [docs] improve button-group docs (#2594) * button CSS text refactors * fix button group alignment support * simplify BG CSS example, fill modifier sets full width/height based on vertical * refactor BG docs & examples * more edits * [docs] refactor datetime docs to focus on React usage (#2596) * refactor datetime docs * timezone docs * [docs] refactor forms docs (#2600) * ControlGroup & FormGroup * merge all text input docs into one file * singular titles * text area props * edits * edits * tag-input add note about newlines, wrap lines * FileInput docs * checkbox etc docs * resolve forms nav: Form controls & Form inputs sections
fixes #2542
refactor all datetime component docs a la #2574 (which this PR is targeting).