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

Highlighting cells on a month level #127

Open
kansimies opened this issue Oct 15, 2024 · 1 comment
Open

Highlighting cells on a month level #127

kansimies opened this issue Oct 15, 2024 · 1 comment

Comments

@kansimies
Copy link

Hello,

I have tried to highlight weekends on a gantt with multiple zoom levels. I ran into an issue where the whole month as a cell gets highlighted if the month starts on a Saturday or Sunday.

Snippet can be seen here:
https://snippet.dhtmlx.com/9hoep8a3

Currently I can go around this by checking the current zoom level, the problem is even bigger though if I apply the same styling to a timeline where the whole month gets highlighted.

@gearcoded
Copy link

@kansimies,
When you use the isWorkTime method and specify only the date parameter, Gantt uses the duration_unit parameter for the unit. So, for the month of week scale, you are checking if there is a working day of the specific date.
You can use the configuration object instead of the date, and specify the unit parameter:
https://docs.dhtmlx.com/gantt/api__gantt_isworktime.html#:~:text=date%20to%20check-,unit,-%2D%20(string)%20optional%2C%20a

Here is the updated snippet:
https://snippet.dhtmlx.com/bgrcik9s

When the unit parameter is specified, Gantt checks if there is working time within that unit for the date, for example if there is any working day within a month. If there are no working days, the method returns false.
You can check that in the following snippet:
https://snippet.dhtmlx.com/my5x5wd8

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