Premium support for our pure JavaScript UI components


Post by 24flow »

Hi

We have received several user reports regarding incorrect week numbering in the scheduler.

I have confirmed this issue is reproducible on your official "Effort" demo. Currently, the first week of January is being incorrectly labeled as Week 53, causing all subsequent weeks to be offset by +1.

import shared from '../_shared/shared.module.js?490592';
import { Splitter, SchedulerPro, ProjectModel, ResourceUtilization, DateHelper, EventModel } from '../../build/schedulerpro.module.js?490592';

class FixedDurationEvent extends EventModel {

static fields = [
    // Change the event default "schedulingMode" to "FixedDuration"
    // which enforces the event to distribute the provided "effort" value over the event duration
    { name : 'schedulingMode', defaultValue : 'FixedDuration' }
];

}

const project = new ProjectModel({
    eventModelClass : FixedDurationEvent,
    loadUrl         : 'data/data.json',
    autoLoad        : true
});

const scheduler = new SchedulerPro({
    appendTo    : 'container',
    minHeight   : 0,
    flex        : '1 1 50%',
    collapsible : true,
    header      : false,

project,

startDate      : new Date(2026, 0, 1),
endDate        : new Date(2026, 4, 30),
viewPreset     : 'dayAndWeek',
eventStyle     : 'filled',
tickSize       : 50,
resourceImages : {
    path      : '../_shared/images/transparent-users/',
    extension : '.png'
},
features : {
    taskEdit : {
        items : {
            // Get rid of "Resources" combo on "General" tab (since we add "Resources" tab)
            generalTab : {
                items : {
                    resourcesField : false
                }
            },
            // Add "Resources" tab (grid allowing to edit event assignments)
            resourcesTab : {
                type      : 'resourcestab',
                weight    : 400,
                // display "Units" column allowing to adjust resource effort contribution level
                showUnits : true
            }
        },
        // slightly extend editor width to fit new tab
        editorConfig : {
            width : '37em'
        }
    }
},

columns : [
    { type : 'resourceInfo', text : 'Name', field : 'name', width : 140 },
    { text : 'City', field : 'city', width : 100 }
],

tbar : [
    {
        type     : 'button',
        ref      : 'zoomInButton',
        icon     : 'b-icon-search-plus',
        text     : 'Zoom in',
        onAction : () => scheduler.zoomIn()
    },
    {
        type     : 'button',
        ref      : 'zoomOutButton',
        icon     : 'b-icon b-icon-search-minus',
        text     : 'Zoom out',
        onAction : () => scheduler.zoomOut()
    }
]
});

new Splitter({
    appendTo    : 'container',
    showButtons : true
});

const resourceUtilization = new ResourceUtilization({
    project,
    hideHeaders : true,
    partner     : scheduler,
    appendTo    : 'container',
    // set a bit larger row height since we use a custom renderer() below
    rowHeight   : 50,
    minHeight   : 0,
    collapsible : true,
    header      : false,
    flex        : '1 1 50%',
    showBarTip  : true,
    columns     : [
        {
            type  : 'tree',
            field : 'name',
            text  : 'Resource/Event',
            renderer({ record, value }) {
                // lets show event start/end for assignment row
                if (record.origin.isAssignmentModel) {
                    // get the assigned event
                    const event = record.origin.event;

                // add few nested tags for event name and for start/end dates
                return {
                    children : [
                        {
                            tag      : 'dl',
                            class    : 'b-assignment-info',
                            children : [
                                // value has event name
                                {
                                    tag  : 'dt',
                                    html : value
                                },
                                {
                                    tag  : 'dd',
                                    html : DateHelper.format(event.startDate, 'L') + ' - ' + DateHelper.format(event.endDate, 'L')
                                }
                            ]
                        }
                    ]
                };
            }

            return value;
        }
    }
],

tbar : [
    {
        type    : 'slidetoggle',
        ref     : 'showBarTip',
        text    : 'Enable bar tooltip',
        tooltip : 'Check to show tooltips when moving mouse over bars',
        checked : true,
        onAction({ source }) {
            resourceUtilization.showBarTip = source.checked;
        }
    }
]
});
Attachments
Screenshot 2026-01-21 at 17.51.01.png
Screenshot 2026-01-21 at 17.51.01.png (499.12 KiB) Viewed 6573 times

Post by mats »

Hi there,

The behavior you're seeing is related to how ISO week numbering interacts with the locale's weekStartDay setting.


Related GitHub Issues:

Root Cause:

The issue stems from two factors:


  1. Locale weekStartDay: The default US English locale uses weekStartDay: 0 (Sunday). ISO week numbering
    strictly requires weeks to start on Monday. When using Sunday as the start day, the week number calculation
    differs from the ISO standard.

  2. Year display in headers: The header was showing the calendar year of the date (e.g., "2025") instead of
    the ISO week's year (which should be "2026" for that first week).


    Workaround:


    Use a locale that has weekStartDay : 1 (Monday), such as EnGb:


    import EnGbLocale from '@bryntum/scheduler/locales/scheduler.locale.EnGb.js';
    LocaleHelper.applyLocale(EnGbLocale);


    Or explicitly set weekStartDay: 1 in your Scheduler config.


Hope this helps!


Post by carlzbg »

My users, within the same customer, using different locales, reported differing week numbers for the same week.
This caused me a few hours of work trying to figure it out.
Week numbers has to be consistent regardless of languages chosen.


Post by marcio »

Hey carlzbg,

Sorry to hear about the time you spent on this.

As Mats mentioned, you can set weekStartDay: 1 in your Scheduler to set the week start and have the week number as you described.

Best regards,
Márcio

How to ask for help? Please read our Support Policy


Post by 24flow »

Despite setting weekStartDay: 1 in the default viewPresets, the week numbering remained inaccurate. To resolve this, we implemented a custom header to override the weekday calculations specifically when using the dayAndWeek preset.

preset.headers = [
          {
            increment: 1,
            unit: "week",
            dateFormat: "{w.}W MMM YYYY"
          },
          { dateFormat: "dd DD", increment: 1, originalDateFormat: "dd DD", unit: "day" }
        ];

Post by kronaemmanuel »

Hey 24flow,

If I set weekStartDay: 1. I see Week 1 2026 in the example you mentioned.

Screenshot 2026-04-07 213445.png
Screenshot 2026-04-07 213445.png (462.2 KiB) Viewed 4484 times

Can you share your code so I can take a look why it's not the same for you?

Regards,
Krona


Post Reply