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] Add an API/option to add more custom time scales #431

Open
KebabRonin opened this issue Sep 13, 2024 · 1 comment
Open

Comments

@KebabRonin
Copy link

KebabRonin commented Sep 13, 2024

Currently, all things depending on the time scale are big if/else trees, for each available time scale. This can make it tedious to add or modify view modes.

It would be nice to have a configuration object to get these settings from, so people can more easily add other time scales without the need to alter/search through the code.

The new option could look something like this:

var gantt = new Gantt(div, tasks, {
   // ...
   view_modes: [
      {
         name: 'Hour',
         step: 3600, // in unix seconds
         snap_interval: 300, // snap task dates to 5 minute intervals
         upper_text: {
            x: 10, // offset from the 'base position'
            period: 3600 * 24, // repeat the upper text for each day
            text: 'DD', // using date_utils or in some date format
            column_width: 38 // using date_utils or in some date format
         },
         lower_text: {/* similar to upper_text */}
      },
      // ... more view modes
   ]
   }
}
@moradlarbi
Copy link

Can you assigne this issue to me please? i want to work on it

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

2 participants