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

Snapping not working when using a custom time axis #2528

Closed
matsbryntse opened this issue Mar 18, 2021 · 0 comments
Closed

Snapping not working when using a custom time axis #2528

matsbryntse opened this issue Mar 18, 2021 · 0 comments
Assignees
Labels
bug Something isn't working forum Issues from forum resolved Fixed but not yet released (available in the nightly builds)
Milestone

Comments

@matsbryntse
Copy link
Member

Forum post

Hi

I am having an issue getting tasks to snap to 15 minute intervals while dragging.

I am using a custom time axis below:

timeAxis: {
            
        continuous: false,
        generateTicks: function generateTicks(start, end, unit, increment) {
            var ticks = [];

            while (start < end) {
                if (unit !== 'hour' || start.getHours() >= 8 && start.getHours() <= 22) {
                    ticks.push({
                        id: ticks.length + 1,
                        startDate: start,
                        endDate: bryntum.schedulerpro.DateHelper.add(start, increment, unit)
                    });
                }

                start = bryntum.schedulerpro.DateHelper.add(start, increment, unit);
            }

            return ticks;
        }
    }

and then I am attempting to get the tasks to snap by doing the following:

timeResolution: 15,
snap: true

However when I use this, the task does not snap. if I remove the timeAxis routine, then the tasks do snap as expected but I do not get the right start and end values for the day. Please can someone help?

@matsbryntse matsbryntse added bug Something isn't working forum Issues from forum labels Mar 18, 2021
@matsbryntse matsbryntse self-assigned this Mar 18, 2021
@matsbryntse matsbryntse added this to the 4.1.0 milestone Mar 18, 2021
@matsbryntse matsbryntse added the ready for review Issue is fixed, the pull request is being reviewed label Mar 20, 2021
@matsbryntse matsbryntse added resolved Fixed but not yet released (available in the nightly builds) and removed ready for review Issue is fixed, the pull request is being reviewed labels Mar 29, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working forum Issues from forum resolved Fixed but not yet released (available in the nightly builds)
Projects
None yet
Development

No branches or pull requests

1 participant