Skip to main content
Hi All,

 

I have installed a go to meeting connector, and when a gotomeeting is scheduled I want the option to add the details to gmail calendar using a custom button. I have to admit I do not code and was given this code from another admin, all I did was update the merge fields to point to the field to put in the data. When I update this code I get the launch of the email calendar but the date is not return the the correct time. It does return the correct date but not the time (it only return 12:00am to 12:00am) no matter what time the event is schedule for...Here is the code, what in the date parameters do I need to fix to retrieve the correct time for the event

 

var meeting = { 

 

id: '{!gtmlt__Meeting__c.Id}', 

 

meetingId: '{!gtmlt__Meeting__c.gtmlt__Meeting_ID__c}', 

 

joinUrl: '{!Event.Location}', 

 

callInfo: '{!JSENCODE( Event.Description )}', 

 

startTime: new Date('{!Event.StartDateTime}'), 

 

endTime: new Date('{!Event.EndDateTime}'), 

 

owner: '{!gtmlt__Meeting__c.OwnerEmail}', 

 

subject: '{!JSENCODE( Event.Subject)}' 

 

}; 

 

console.log(meeting); 

 

function formatDate(meetingTime) { 

 

return meetingTime.toISOString().replace(/-|:|/gi,'').split('.')[0] + 'Z'; 

 

 

var startDate = formatDate(meeting.startTime); 

 

var endDate = formatDate(meeting.endTime); 

 

var gLink = 'http://www.google.com/calendar/event?action=TEMPLATE&text='; 

 

var action = encodeURIComponent(meeting.subject) + '&dates='+ startDate + '/' + endDate + '&details='; 

 

action += encodeURIComponent(meeting.callInfo + '\n\n' + meeting.joinUrl) + '&location='+ encodeURIComponent(meeting.joinUrl); 

 

gLink = gLink + action; 

 

var win = window.open(gLink, '_blank'); 

 

win.focus();
2 réponses
0/9000