]> git.ipfire.org Git - thirdparty/Chart.js.git/commitdiff
Update Display Format table
authorAkihiko Kusanagi <nagi@nagi-p.com>
Fri, 23 Jun 2017 03:38:53 +0000 (20:38 -0700)
committerEvert Timberg <evert.timberg+github@gmail.com>
Sat, 24 Jun 2017 10:41:42 +0000 (06:41 -0400)
- Up to date with the latest code
- Added Example column

docs/axes/cartesian/time.md

index b6035191efb1977dbd2a61785e7e2bdc18024ebd..6b6aaa64f15d6ab73408bbab8015474bac1fa972 100644 (file)
@@ -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
 
@@ -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
+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.
 
@@ -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.
\ No newline at end of file
+If this is a function, it must return a moment.js object given the appropriate data value.