-
-
Notifications
You must be signed in to change notification settings - Fork 6.6k
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
0.5.0 no longer respects custom date definitions in Gantt diagrams #171
Comments
I realize that is a bit unclear from the documentation. It was nesseccary to refactor the configuration handling in mermaid. Initialization can be done using the mermaid.initialize method which in turn uses mermaidAPI.initialize. initialize takes a configuration object as a parameter. The configuration object has general things in the root as startOnLoad and closeCssStyles and has sub objects with configuration specific for a diagram type named after the diagram type. Settings not part of the initialization call uses the default setting. In your case it would look something like the code below. You could also experiment with removing settings you have not actively changed so that the default values are used in order to simplify the code.
|
Thanks! The following solved this for me: mermaid.initialize({
startOnLoad:true,
gantt: {
axisFormatter: [
// Monday a week
["%-m/%-d", function (d) {
return d.getDay() == 1;
}]
]
}
}); |
In 0.4.0, I was able to customize the date definitions in the Gantt diagram as seen below:
I did that with this snippet of code:
Please note the
%-m/%-d
formatting for "Monday a week".In 0.5.0, this customization is no longer respected and my diagram appears like this:
Am I missing some change in the customization JS or did this just break?
The text was updated successfully, but these errors were encountered: