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

Feature Request - Format Date/Time Output #48

Open
Heiko-san opened this issue Jun 19, 2019 · 3 comments
Open

Feature Request - Format Date/Time Output #48

Heiko-san opened this issue Jun 19, 2019 · 3 comments

Comments

@Heiko-san
Copy link

Actually you can perfectly use the gantt diagram to draw tasks on hours, minutes or even seconds base.
This could make mermaid a powerful tool to easily visualize time trackings (like visualize a taskwarrior database).

https://mermaidjs.github.io/mermaid-live-editor/#/edit/eyJjb2RlIjoiZ2FudHRcbnRpdGxlIFRpbWUgVHJhY2tpbmdcbmRhdGVGb3JtYXQgIEhIOm06c1xuc2VjdGlvbiBNb25kYXlcbkEgdGFzayAgICAgICAgICAgOiBhMSwgMDk6MDA6MDAsIDA5OjMwOjAwXG5Bbm90aGVyIHRhc2sgICAgIDphZnRlciBhMSAgLCAyMG1cbnNlY3Rpb24gVHVlc2RheVxuVGFzayBpbiBzZWMgICAgICA6MDk6MDA6MzAgICwgMTJtXG5hbm90aGVyIHRhc2sgICAgICA6IDI0bSIsIm1lcm1haWQiOnsidGhlbWUiOiJkZWZhdWx0In19

However the scale at the bottom still only prints the date.

It would be helpful if the dateFormat field would be evaluated for the date/time output aswell, or if you had another outputFormat field for that.

@justinrush
Copy link

This would be really helpful - with longer gantts with a mix of long and short tasks, the bottom scale is unreadable. A separate field would be great so we can specify year-month-date as start/ends but show month-date on the output.

@kut
Copy link

kut commented May 12, 2020

It's not in the docs, but axisFormat ended up solving this for me. It uses a different formatting to dateFormat, as explained under "Scale" here: https://mermaid-js.github.io/mermaid/#/gantt?id=scale

Example:

gantt
    dateFormat   YYYY-MM-DD
    axisFormat   %b %Y

@arvidj
Copy link

arvidj commented Apr 5, 2024

@kut Here's a full example using axisFormat to solve the problem:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants