Merge pull request #1373 from phschaer/patch-1

expanded documentation on date formats for gantt
This commit is contained in:
Knut Sveidqvist 2020-04-27 19:51:13 +02:00 committed by GitHub
commit aa2845a730
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 14 additions and 11 deletions

View File

@ -127,23 +127,21 @@ Tbd
## Setting dates ## Setting dates
Tbd `dateFormat` defines the format of the date **input** of your gantt elements. How these dates are represented in the rendered chart **output** are defined by `axisFormat`.
### Date format ### Input date format
The default date format is YYYY-MM-DD. You can define your ``dateFormat``. For example: 2020-3-7 The default input date format is `YYYY-MM-DD`. You can define your custom ``dateFormat``.
``` ```
dateFormat YYYY MM DD dateFormat YYYY-MM-DD
``` ```
The following formating options are supported:
### Diagram definition ```
Input Example Description: Input Example Description:
```
YYYY 2014 4 digit year YYYY 2014 4 digit year
YY 14 2 digit year YY 14 2 digit year
Q 1..4 Quarter of year. Sets month to first month in quarter. Q 1..4 Quarter of year. Sets month to first month in quarter.
@ -154,8 +152,6 @@ Do 1st..31st Day of month with ordinal
DDD DDDD 1..365 Day of year DDD DDDD 1..365 Day of year
X 1410715640.579 Unix timestamp X 1410715640.579 Unix timestamp
x 1410715640579 Unix ms timestamp x 1410715640579 Unix ms timestamp
Input Example Description
H HH 0..23 24 hour time H HH 0..23 24 hour time
h hh 1..12 12 hour time used with a A. h hh 1..12 12 hour time used with a A.
a A am pm Post or ante meridiem a A am pm Post or ante meridiem
@ -169,8 +165,15 @@ Z ZZ +12:00 Offset from UTC as +-HH:mm, +-HHmm, or Z
More info in: http://momentjs.com/docs/#/parsing/string-format/ More info in: http://momentjs.com/docs/#/parsing/string-format/
### Output date format on the axis
### Scale The default output date format is YYYY-MM-DD. You can define your custom ``axisFormat``, like `2020-Q1` for the first quarter of the year 2020.
```
axisFormat %Y-%m-%d
```
The following formating strings are supported:
``` ```
%a - abbreviated weekday name. %a - abbreviated weekday name.