mermaid-js / mermaid

Generation of diagrams like flowcharts or sequence diagrams from text in a similar manner as markdown
https://mermaid.js.org
MIT License
71.53k stars 6.48k forks source link

Axis Format for Calendar Week is off by one week #1785

Open paesku opened 3 years ago

paesku commented 3 years ago

Describe the bug Seems as that Axis Format for Calendar Week is off by one week

To Reproduce

gantt
    title A Gantt Diagram
    dateFormat  DD-MM-YYYY
    axisFormat %W
    section Section
    kw1              :30-12-2019, 7d
    kw2              :06-01-2020, 7d
    kw3              :13-01-2020, 7d

Expected behavior Bildschirmfoto 2020-11-20 um 12 21 20

Screenshots Bildschirmfoto 2020-11-20 um 12 19 57

Additional context Add any other context about the problem here.

go2null commented 3 years ago

Documentation says first week is 00, not 01. https://mermaid-js.github.io/mermaid/#/gantt?id=output-date-format-on-the-axis

%W - week number of the year (Monday as the first day of the week) as a decimal number [00,53].

Note that this is unexpected. And does not follow ISO-8601, which defines the first week as 01. https://en.wikipedia.org/wiki/ISO_week_date#First_week