Year get caclulated wrong when using Fiscal Year


when I use fiscal year which starts at Oct 1 , the first year is calculated wrong. For example, if I have tasks starts at Oct 1 2018 , the chart will show like this:
FY 2017 FY 2017 FY 2018 …
I’m attaching a sample project here.

Has anyone had the same issue? any solution would be appreciated

FiscalYear.zip (1.1 MB)


Hi @thao_trinh!

  1. Your “fiscalYearLabel()” function is unused.

  2. You need to use gantt.templates.date_scale to set custom date values in the scale instead gantt.config.date_scale. Here is a related article:

  3. Please remove gantt.config.date_scale and set your “fiscalYearLabel()” function to the gantt.templates.date_scale.

  4. Please pay attention you need to set templates.date_scale value in the “onTemplatesReady” event.
    So you need to add such code to your project:

gantt.attachEvent("onTemplatesReady", function(){
  gantt.templates.date_scale = fiscalYearLabel 

Here is a snippet with your full code modified:

You can use your “fiscalYearLabel()” function as a template for the subscale. Just add this object {unit:"fiscal_year", step:1, template:fiscalYearLabel} to gantt.config.subscales array. Here is a snippet you can see how it can be implemented:


Hello Thao,
The dev team updated the scales API. Now you can specify the templates directly in the scale property and list all scales you need in one object:

Originally, you had this configuration:
Here is the updated configuration: