Premium support for our pure JavaScript UI components


Post by symas »

Hi

I have configured the scheduler, that is shows always a week.

for this, I have set the startDate to monday and endDate to saturday, weekStartDay = 1 and this in the preset:

                timeResolution: {
                    unit: 'day',
                    increment: 1
                },

            shiftIncrement: 1,
            shiftUnit: 'week',

for scrolling to a specific date, I have implemented this:

    scrollTo(date: Date) {
        var bow = this.dateService.BeginOfWeek(date);  // this is calculating the monday of the week, where date is in
        bow.setDate(bow.getDate() + 4);
        this.scheduler1.scrollToDate(bow);
        this.scheduler2.scrollToDate(bow);
    }

I add 4 days to the monday because I have determined, that it will always scrolling in such a way, that the monday is "in the middle of the view".

But now, when I execute my scrollTo()-Function, I get 8 days into the view (from monday to the next monday).

Can you help me, how can I scroll that the view will always show monday to sunday.

Thank you.

Best Regards
Thomas


Post by alex.l »

Hi Thomas,

To have custom dates for start and end date of timeline, you need to set start and end dates instead of call scrollTo. In this case it won't be auto handled and you will see exactly what you need.
https://bryntum.com/products/schedulerpro/docs/api/SchedulerPro/view/SchedulerPro#function-setTimeSpan

All the best,
Alex


Post by symas »

Thank you, Alex.


Post Reply