Ask for help related to our 2.x versions.

Post by jdap »

Hello all,

During Daylight Savings time (where the clock is set back one hour) we see a 1 day Duration task incorrectly setting its EndDate to the day after the StartDate. The source of this problem is crossing the DST threshold. All 1 day duration tasks should begin and end at the start and end of the work days, respectively, but instead they are shifted.

(Screenshots are semi-large, you may need to click to see their full content)

How it should look:
1 day per task, StartDate and EndDate the same:
Screen Shot 2015-08-12 at 12.19.07 PM.png
Screen Shot 2015-08-12 at 12.19.07 PM.png (56.51 KiB) Viewed 8195 times
And the corresponding, correct, database rows:
Name	startDate	endDate	duration
-	2015-11-09 01:00:00	2015-11-18 23:00:00	10
A	2015-11-09 01:00:00	2015-11-09 23:00:00	1
B	2015-11-10 01:00:00	2015-11-10 23:00:00	1
C	2015-11-11 01:00:00	2015-11-11 23:00:00	1
D	2015-11-12 01:00:00	2015-11-12 23:00:00	1
E	2015-11-13 01:00:00	2015-11-13 23:00:00	1
F	2015-11-14 01:00:00	2015-11-14 23:00:00	1
G	2015-11-15 01:00:00	2015-11-15 23:00:00	1
H	2015-11-16 01:00:00	2015-11-16 23:00:00	1
I	2015-11-17 01:00:00	2015-11-17 23:00:00	1
J	2015-11-18 01:00:00	2015-11-18 23:00:00	1
Gantt of all 3 sets of tasks:
Screen Shot 2015-08-12 at 12.47.41 PM.png
Screen Shot 2015-08-12 at 12.47.41 PM.png (235.78 KiB) Viewed 8195 times
Values in the DB show that a single DST date alters the working date-times for many tasks in the same connected Gantt graph. e.g., instead of 01:00-23:00 they end at 22:00 and begin at either 01:00 or 22:00.
Screen Shot 2015-08-12 at 12.44.07 PM.png
Screen Shot 2015-08-12 at 12.44.07 PM.png (118.67 KiB) Viewed 8195 times


Anyone have creative suggestions on ways to fix (or work-around) this problem in the scheduler?

Setup:
* Gantt 2.2.24 and Scheduler 2.2.24
* 10 tasks, 1 day duration each.
* Total time should be 10 days.
* For a series of tasks which never cross the DST, this is true.
* For any series of tasks where one task begins on the DST date, their dates are incorrect.
* Our calendars are initialized at 22 hours per day, 1am to 11pm. (Timezone unknown - no known way to specify it)
* All tasks use the same Calendar
* The calendar has 7 workdays (no days off) to simplify the reproduction steps

var newCal = new Gnt.data.calendar.BusinessTime({
    calendarId : cal.calendarId,
    name : cal.Name,
    weekendsAreWorkdays : false,
    weekendFirstDay : 7,
    weekendSecondDay : 7,
    data : cal.days,
    hoursPerDay  : 22,
    defaultAvailability : [ '01:00-23:00']
});
* 2015 Daylight Savings occurs November 1st

As you would expect, if your browser is in a different timezone you will have different tasks effected. For example, if a user in Dublin loads our Gantt, their tasks on October 25th are screwed up, whereas the same Gantt is screwed up for US users if those subtasks touch November 1st.

Post by jdap »

Forum seems to be clipping images to a particular width. Here is the Gantt as rendered. Date-Times are above, in prior post:
Screen Shot 2015-08-12 at 12.50.19 PM.png
Screen Shot 2015-08-12 at 12.50.19 PM.png (85.11 KiB) Viewed 8194 times

Post by Maxim Gorkovsky »

Hello.
2.2.24 is pretty old version, we now have 2.5.9, and between those releases we did change some DST-related logic. Please provide us with runnable test case or check latest version.

Post by jdap »

Thanks Maxim. Can you provide a link to the changelogs which state which DST bugs have been fixed?

Post by Maxim Gorkovsky »

I'm afraid no, changelog may not contain DST abbreviation for release that had some changes related to it. Cannot you just try latest version?

Post by jdap »

Attached is a zip file which shows the bug reproducable in 2.2.24 and 2.5.4
Screenshot of bug in example code
Screenshot of bug in example code
Screen Shot 2015-08-13 at 4.47.51 PM.png (54.02 KiB) Viewed 8176 times
gantt-2.2.24-and-2.5.4-calbug.zip
Repro zip. examples/calbug folder, based on examples/calendar
(11.07 KiB) Downloaded 380 times

Post by Maxim Gorkovsky »

We also need to know your timezone

Post by jdap »

To see the bug triggered on tasks on November 1st, use Central Daylight Time.

Post by Maxim Gorkovsky »

This is not a bug.
Because of clocks adjusted backwards 1 hour, november 1st lasts for 25 hours, not 24. Sequence would be:
31/10 23:00 - 1/11 00:00 - 1/11 01:00 (summer time) - 1/11 01:00 (DST) - 1/11 02:00.
That's why duration of 22 hours between 1am and 11pm shown different for that day. I'm afraid to get rid of this, you'll have to increase duration of one particular task by 1 hour.

Post by jdap »

Is there a way to set the timezone of the Gnt.data.calendar.BusinessTime or the Gnt.data.Calendar to which the task is bound?

Otherwise, two different users loading the same data will continue to see different results.

Post Reply