Page 1 of 2

[REACT] Resource histogram behaves differently depending on timezone

Posted: Thu Dec 08, 2022 3:08 pm
by tulioassis

Hey, we are getting different results for users in USA and Brazil.

Screenshot 1:
Image

Screenshot 2:
Image

Any idea on it?

Dataset is attached.

Edit: removed the dataset


Re: [REACT] Resource histogram behaves differently depending on timezone

Posted: Fri Dec 09, 2022 5:00 am
by alex.l

Hi tulioassis,

Could you please describe what exactly is wrong by your opinion? Expected and actual results.
Thanks.


Re: [REACT] Resource histogram behaves differently depending on timezone

Posted: Fri Dec 09, 2022 4:24 pm
by tulioassis

Hey alex.l, in my opinion it should not show as overbooked on the screenshot 2.

Here we have another example:

The Image 1 shows some tasks and the resource histogram. It's saying that Apr 11 is overbooked (red color).
But we don't have anything else assigned for that resource on Apr 11.
When we move ahead the task, we can see that Apr 11 becomes free on Image 2.

Question: why only one task is overbooking the Apr 11? Am I missing something?

Image 1:
Image

Image 2:
Image


Re: [REACT] Resource histogram behaves differently depending on timezone

Posted: Mon Dec 12, 2022 7:38 am
by alex.l

The data attached looks different than on your screenshot (with tons of tasks) and I see 48/24 hours overload, which looks correct to me.
Any chance to get the minimal dataset like on your screenshot to check it fast?
As an idea, there is a DST change in USA in these days, but no change in Brasil. In case duration calculated, it might be 1 extra hour appeared after switch to region without dataset, or vice versa, because of constraints you used in tasks.

But I need to check that with dataset you used.

Meanwhile, try to get startDate/endDate/duration for those tasks and see if they start/end right after each other or have some overlapping.


Re: [REACT] Resource histogram behaves differently depending on timezone

Posted: Mon Dec 12, 2022 2:12 pm
by tulioassis

Hey alex.l, the dataset was attached on the first post. I just filtered to the task that we got the issue.


Re: [REACT] Resource histogram behaves differently depending on timezone

Posted: Tue Dec 13, 2022 6:12 am
by alex.l

Sorry, I don't see "BAKER B" in dataset and can't find correct place in a huge dataset to test that. Could you please try to remove not required data?


Re: [REACT] Resource histogram behaves differently depending on timezone

Posted: Tue Dec 13, 2022 4:11 pm
by tulioassis

Hey alex.l, just get a small dataset where you can reproduce the issue.

You should be able to get overbooked when you load the histogram in the UTC-05 Eastern Time Timezone and all green when you load in the UTC-3 Brasilia timezone.


Re: [REACT] Resource histogram behaves differently depending on timezone

Posted: Tue Dec 13, 2022 4:28 pm
by tulioassis

Or if you want, you can use the following code to reproduce it on any demo (e.g. https://bryntum.com/products/gantt/examples/resourcehistogram/)

Please make sure you are alternating between the timezones to see the behavior.

import { Gantt, ProjectModel, ResourceHistogram, Splitter } from '../../build/gantt.module.js?463787';
import shared from '../_shared/shared.module.js?463787';

const project = (window.project = new ProjectModel({
  calendar: 'general',
  tasks: [
    {
      id: '639364727fe46b4c86c420cc',
      name: 'TASK 1',
      children: [
        {
          name: 'Task 1',
          id: '639364727fe46b4c86c420cc-task1',
          startDate: '2028-2-17',
          endDate: '2028-3-3',
          duration: 15,
          constraintType: 'startnoearlierthan',
          constraintDate: '2028-2-17',
        },
        {
          name: 'Task 2',
          id: '639364727fe46b4c86c420cc-task2',
          startDate: '2028-3-3',
          endDate: '2028-3-18',
          duration: 15,
          constraintType: 'startnoearlierthan',
          constraintDate: '2028-3-3',
        },
        {
          name: 'Final',
          id: '639364727fe46b4c86c420cc-final',
          startDate: '2028-4-1',
          endDate: '2028-4-1',
          duration: 0,
          constraintType: 'startnoearlierthan',
          constraintDate: '2028-4-1',
        },
      ],
    },
    {
      id: '639364727fe46b4c86c420cd',
      name: 'TASK 2',
      children: [
        {
          name: 'Task 1',
          id: '639364727fe46b4c86c420cd-task1',
          startDate: '2028-3-3',
          endDate: '2028-3-18',
          duration: 15,
          constraintType: 'startnoearlierthan',
          constraintDate: '2028-3-3',
        },
        {
          name: 'Task 2',
          id: '639364727fe46b4c86c420cd-task2',
          startDate: '2028-3-18',
          endDate: '2028-4-2',
          duration: 15,
          constraintType: 'startnoearlierthan',
          constraintDate: '2028-3-18',
        },
        {
          name: 'Final',
          id: '639364727fe46b4c86c420cd-final',
          startDate: '2028-4-16',
          endDate: '2028-4-16',
          duration: 0,
          constraintType: 'startnoearlierthan',
          constraintDate: '2028-4-16',
        },
      ],
    },
    {
      id: '639364727fe46b4c86c420ce',
      name: 'TASK 3',
      children: [
        {
          name: 'Task 1',
          id: '639364727fe46b4c86c420ce-task1',
          startDate: '2028-3-18',
          endDate: '2028-4-2',
          duration: 15,
          constraintType: 'startnoearlierthan',
          constraintDate: '2028-3-18',
        },
        {
          name: 'Task 2',
          id: '639364727fe46b4c86c420ce-task2',
          startDate: '2028-4-2',
          endDate: '2028-4-17',
          duration: 15,
          constraintType: 'startnoearlierthan',
          constraintDate: '2028-4-2',
        },
        {
          name: 'Final',
          startDate: '2028-5-1',
          endDate: '2028-5-1',
          duration: 0,
          constraintType: 'startnoearlierthan',
          constraintDate: '2028-5-1',
        },
      ],
    },
  ],
  assignments: [
    {
      id: '639364727fe46b4c86c420cc-task1',
      event: '639364727fe46b4c86c420cc-task1',
      resource: '639364203be5fd00129e9ab2',
    },
    {
      id: '639364727fe46b4c86c420cc-task2',
      event: '639364727fe46b4c86c420cc-task2',
      resource: '639364203be5fd00129e9ab5',
    },
    {
      id: '639364727fe46b4c86c420cd-task1',
      event: '639364727fe46b4c86c420cd-task1',
      resource: '639364203be5fd00129e9ab2',
    },
    {
      id: '639364727fe46b4c86c420cd-task2',
      event: '639364727fe46b4c86c420cd-task2',
      resource: '639364203be5fd00129e9ab5',
    },
    {
      id: '639364727fe46b4c86c420ce-task1',
      event: '639364727fe46b4c86c420ce-task1',
      resource: '639364203be5fd00129e9ab2',
    },
    {
      id: '639364727fe46b4c86c420ce-task2',
      event: '639364727fe46b4c86c420ce-task2',
      resource: '639364203be5fd00129e9ab5',
    },
  ],
  dependencies: [
    {
      id: '639364727fe46b4c86c420cc-preparationWork639364727fe46b4c86c420cc-task1',
      fromTask: '639364727fe46b4c86c420cc-preparationWork',
      toTask: '639364727fe46b4c86c420cc-task1',
      type: 2,
    },
    {
      id: '639364727fe46b4c86c420cc-task1639364727fe46b4c86c420cc-task2',
      fromTask: '639364727fe46b4c86c420cc-task1',
      toTask: '639364727fe46b4c86c420cc-task2',
      type: 2,
    },
    {
      id: '639364727fe46b4c86c420cc-task2639364727fe46b4c86c420cc-final',
      fromTask: '639364727fe46b4c86c420cc-task2',
      toTask: '639364727fe46b4c86c420cc-final',
      type: 2,
    },
    {
      id: '639364727fe46b4c86c420cd-preparationWork639364727fe46b4c86c420cd-task1',
      fromTask: '639364727fe46b4c86c420cd-preparationWork',
      toTask: '639364727fe46b4c86c420cd-task1',
      type: 2,
    },
    {
      id: '639364727fe46b4c86c420cd-task1639364727fe46b4c86c420cd-task2',
      fromTask: '639364727fe46b4c86c420cd-task1',
      toTask: '639364727fe46b4c86c420cd-task2',
      type: 2,
    },
    {
      id: '639364727fe46b4c86c420cd-task2639364727fe46b4c86c420cd-final',
      fromTask: '639364727fe46b4c86c420cd-task2',
      toTask: '639364727fe46b4c86c420cd-final',
      type: 2,
    },
    {
      id: '639364727fe46b4c86c420ce-preparationWork639364727fe46b4c86c420ce-task1',
      fromTask: '639364727fe46b4c86c420ce-preparationWork',
      toTask: '639364727fe46b4c86c420ce-task1',
      type: 2,
    },
    {
      id: '639364727fe46b4c86c420ce-task1639364727fe46b4c86c420ce-task2',
      fromTask: '639364727fe46b4c86c420ce-task1',
      toTask: '639364727fe46b4c86c420ce-task2',
      type: 2,
    },
    {
      id: '639364727fe46b4c86c420ce-task2639364727fe46b4c86c420ce-final',
      fromTask: '639364727fe46b4c86c420ce-task2',
      toTask: '639364727fe46b4c86c420ce-final',
      type: 2,
    },
  ],
  resources: [
    {
      id: '639364203be5fd00129e9ab5',
      name: 'Resource 1',
    },
    {
      id: '639364203be5fd00129e9ab2',
      name: 'Resource 2',
    },
  ],
  calendars: [ 
    {
      id: 'general',
      name: 'General',
      intervals: [
        {
          recurrentStartDate: 'on Sat at 0:00',
          recurrentEndDate: 'on Mon at 0:00',
          isWorking: true,
        },
      ],
    },
  ],
}));

const gantt = new Gantt({
  project,
  appendTo: 'container',
  columns: [
    { type: 'name', width: 280 },
    { type: 'resourceassignment', showAvatars: true, width: 170 },
  ],
});

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

const histogram = (window.histogram = new ResourceHistogram({
  appendTo: 'container',
  project,
  hideHeaders: true,
  partner: gantt,
  columns: [{ type: 'resourceInfo', field: 'name', showEventCount: false, flex: 1 }],
}));



Re: [REACT] Resource histogram behaves differently depending on timezone

Posted: Wed Dec 14, 2022 7:35 am
by tasnim

Reproduced! We'll check what's wrong! Here is the ticket https://github.com/bryntum/support/issues/5782

Thank you for your report.

Good Luck :)


Re: [REACT] Resource histogram behaves differently depending on timezone

Posted: Wed Dec 28, 2022 6:24 pm
by tulioassis

Thank you!