From f1cbd79bb3921ad71df82809a6ad00ba162514ca Mon Sep 17 00:00:00 2001 From: Bert Date: Fri, 9 Aug 2024 14:43:01 -0700 Subject: [PATCH] (Re)add documentation in the right place --- packages/mermaid/src/docs/syntax/gantt.md | 32 +++++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/packages/mermaid/src/docs/syntax/gantt.md b/packages/mermaid/src/docs/syntax/gantt.md index 8497b96a13..cbe4bad6b0 100644 --- a/packages/mermaid/src/docs/syntax/gantt.md +++ b/packages/mermaid/src/docs/syntax/gantt.md @@ -253,6 +253,38 @@ gantt ```warning `millisecond` and `second` support was added in v10.3.0 + +### Changing Today (v\+) + +By default, the today marker uses the current date. Use `today` to set a custom date, using the `dateFormat`. + +```mermaid-example +gantt + title A Gantt Diagram With Custom Today + dateFormat YYYY-MM-DD + today 2024-01-20 + section Section + A task :a1, 2024-01-01, 30d + Another task :after a1, 20d +``` + +You can also use a duration: + +```mermaid-example +--- +displayMode: compact +--- +gantt + title A Gantt Diagram With Custom Today (Duration) + dateFormat x + axisFormat %L ms + today 18ms + todayMarker stroke-width:2px,stroke:#FF0,opacity:0.5 + section Graphics + Draw 1: a1, 0, 28ms + Draw 2: after a1, 20ms + section Compute + Kernel: b1, 20, 12ms ``` ## Output in compact mode