Problem with iCal UTC and proposed fix

I was trying to get an ics that I had downloaded from Google Calendar to load into scheduler today and found the events were listed on my calendar with their UTC times rather than local time. It appears scheduler does not honor the time zone in the ics file and it assumes the DTSTART and DTEND times are local (does not try to the process the last character of the time string which indicates the time zone - (typically Z for Zulu - which is what Google does). I tried using the server_utc flag to work around this to no avail.

I stepped through the code and found that there does appear to be a bug in the way the scheduler processes UTC for iCal so even if it doesn’t support reading the time zone indicator from the time string, a fix to this bug would allow the server_utc flag to work around the problem.

Does anyone know how to submit a bug and proposed fix without a license?

On the chance that there is no other way to do this, I will submit the proposed bug fix here:
Line 5090 of the uniminified source is attempting to use the Date.UTC initializer if server_utc is specified AND if no time was specified. As the comment implies the intention was to use the UTC initializer if server_utc is specified AND time is also specified, the fix is to remove the ‘!’ on that line:

Change this (line 5090):

		if (scheduler.config.server_utc && !t[1]) { // if no hours/minutes were specified == full day event

to this:

		if (scheduler.config.server_utc && t[1]) { // if no hours/minutes were specified == full day event

Hi,
sorry for a delay with the reply and many thanks for contributing!
You can open an issue in a public repository of a component
github.com/DHTMLX/scheduler/

Regarding the issue - yes, you’re right, seems like the ical parser does not support neither UTC marker nor timezone reference property

Though, I’m not quite sure about the fix you proposing.
If I understood everything right, there are three different ways to define datetime in ical:DTSTART:19970714T133000 ;Local time DTSTART:19970714T173000Z ;UTC time DTSTART;TZID=US-Eastern:19970714T133000 ;Local time and time zone reference
kanzaki.com/docs/ical/dateTime.html

If that is right, then the correct way to decide whether to use utc or a local time is to check the 7-th character of the time part. The complete patch may look following:[code]scheduler.ical.parse_date = function(value,dh,dm){
var t = value.split(“T”);

var utcMark = false;
if (t[1]){
	dh=t[1].substr(0,2);
	dm=t[1].substr(2,2);
	utcMark = !!(t[1][6] == "Z");// utc vs local time
}
var dy = t[0].substr(0,4);
var dn = parseInt(t[0].substr(4,2),10)-1;
var dd = t[0].substr(6,2);

if(scheduler.config.server_utc || utcMark){
	return new Date(Date.UTC(dy,dn,dd,dh,dm)) ;
}else{
	return new Date(dy,dn,dd,dh,dm);
}

};[/code]
The dates with the time zone reference still won’t be processed correctly since scheduler works with native dates which timezone can’t be specified that easily