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

[docs] refactor datetime docs to focus on React usage #2596

Merged
merged 2 commits into from
Jun 18, 2018

Conversation

giladgray
Copy link
Contributor

@giladgray giladgray commented Jun 13, 2018

fixes #2542

refactor all datetime component docs a la #2574 (which this PR is targeting).

@blueprint-bot
Copy link

refactor datetime docs

Preview: documentation | landing | table

<DateRangeInput
formatDate={date => date.toLocaleString()}
onChange={this.handleRangeChange}
parseDate={str => new Date(str)}
Copy link
Contributor Author

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

@blueprint-bot
Copy link

timezone docs

Preview: documentation | landing | table

Copy link

@benjdj6 benjdj6 left a 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
Copy link

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.

Copy link
Contributor Author

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)

Copy link
Contributor Author

Choose a reason for hiding this comment

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


@## JavaScript API
You can control the selected date by setting the `value` prop, or use the
Copy link

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.
Copy link

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:
Copy link

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
Copy link

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
Copy link

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
Copy link

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
Copy link

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
Copy link

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
Copy link

Choose a reason for hiding this comment

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

prop -> property

@giladgray giladgray merged commit ff3686e into gg/docs-rewrite Jun 18, 2018
@giladgray giladgray deleted the gg/docs-datetime branch June 18, 2018 18:05
giladgray added a commit that referenced this pull request Jun 18, 2018
* 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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants