From 9ff8e9bd003a727f49aebed1efb4342409f82e86 Mon Sep 17 00:00:00 2001 From: nicolas Date: Mon, 14 Jun 2021 19:18:53 +0200 Subject: [PATCH] Calculate proper duration --- lib/videoClient.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/videoClient.ts b/lib/videoClient.ts index e48ef404..62c653c6 100644 --- a/lib/videoClient.ts +++ b/lib/videoClient.ts @@ -85,11 +85,11 @@ const ZoomVideo = (credential): VideoApiAdapter => { const translateMeeting = (meeting: VideoMeeting) => { // Documentation at: https://marketplace.zoom.us/docs/api-reference/zoom-api/meetings/meetingcreate - return { + const meet = { topic: meeting.title, type: 2, // Means that this is a scheduled meeting start_time: meeting.startTime, - duration: 60, //TODO calculate endTime - startTime (in minutes, int) + duration: ((new Date(meeting.endTime)).getTime() - (new Date(meeting.startTime)).getTime()) / 60000, //schedule_for: "string", TODO: Used when scheduling the meeting for someone else (needed?) timezone: meeting.timezone, //password: "string", TODO: Should we use a password? Maybe generate a random one? @@ -110,6 +110,8 @@ const ZoomVideo = (credential): VideoApiAdapter => { registrants_email_notification: true } }; + + return meet; }; return {