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

Update Display Format table #4418

Merged
merged 1 commit into from
Jun 24, 2017
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
26 changes: 13 additions & 13 deletions docs/axes/cartesian/time.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ The following options are provided by the time scale. They are all located in th
| `tooltipFormat` | `String` | | The moment js format string to use for the tooltip.
| `unit` | `String` | `false` | If defined, will force the unit to be a certain type. See [Time Units](#scales-time-units) section below for details.
| `stepSize` | `Number` | `1` | The number of units between grid lines.
| `minUnit` | `String` | `millisecond` | The minimum display format to be used for a time unit.
| `minUnit` | `String` | `'millisecond'` | The minimum display format to be used for a time unit.

## Date Formats

Expand Down Expand Up @@ -58,17 +58,17 @@ var chart = new Chart(ctx, {
## Display Formats
The following display formats are used to configure how different time units are formed into strings for the axis tick marks. See [moment.js](http://momentjs.com/docs/#/displaying/format/) for the allowable format strings.

Name | Default
--- | ---
millisecond | 'SSS [ms]'
second | 'h:mm:ss a'
minute | 'h:mm:ss a'
hour | 'MMM D, hA'
day | 'll'
week | 'll'
month | 'MMM YYYY'
quarter | '[Q]Q - YYYY'
year | 'YYYY'
Name | Default | Example
--- | --- | ---
millisecond | 'h:mm:ss.SSS a' | 11:20:01.123 AM
Copy link
Member

Choose a reason for hiding this comment

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

Good catch for millisecond :)

second | 'h:mm:ss a' | 11:20:01 AM
minute | 'h:mm a' | 11:20 AM
hour | 'hA' | 11AM
day | 'MMM D' | Sep 4
week | 'll' | Sep 4 2015
month | 'MMM YYYY' | Sep 2015
quarter | '[Q]Q - YYYY' | Q3 - 2015
year | 'YYYY' | 2015

For example, to set the display format for the 'quarter' unit to show the month and year, the following config would be passed to the chart constructor.

Expand All @@ -94,4 +94,4 @@ var chart = new Chart(ctx, {
## Parser
If this property is defined as a string, it is interpreted as a custom format to be used by moment to parse the date.

If this is a function, it must return a moment.js object given the appropriate data value.
If this is a function, it must return a moment.js object given the appropriate data value.
Copy link
Member

Choose a reason for hiding this comment

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

What's the change on this line?

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 guess my editor may have inserted a newline at the end of file. I think this is a good practice.

Copy link
Member

Choose a reason for hiding this comment

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

Agree, I didn't notice it was the EOF.