Creating an ics file, continued
function createics (schedule) { ….
//setting time
var hour = lessthanten(schedule[i].datetime.getHours());
var minutes = lessthanten(schedule[i].datetime.getMinutes());
var seconds = lessthanten(schedule[i].datetime.getSeconds());
var newtime = schedule[i].datetime.getTime() + (50*60*1000);
newtime = new Date(newtime);
var endhour = lessthanten(newtime.getHours());
var endminutes = lessthanten(newtime.getMinutes());
var dtstart = "DTSTART:" + basicdate + "T" + hour + minutes + seconds;
var dtend = "DTEND:" + basicdate + "T" + endhour + endminutes + seconds;
...//Other strings
}
finalics += "END:VCALENDAR";
return finalics
};
Then I set the endhour and endminutes. Like with the date (discussed in my last entry), I simply concatenate the items together to get my DTSTART and DTEND times. This is a basic abbreviation where DTSTART is date/time start and respectively DTEND is date/time end. The format for date and time entry for ics files is the date, followed by a T to indicate time and then the time. So I grab my basicdate that created last entry, tack it on to the beginning of these variables, input a T for time, and then concatenate the rest of the information on the end.
Up Next Time: End of ics file creation