Skip to main content

Hey Calendly!


I’m using the `Calendly.initInlineWidget` JavaScript embed API. I need to know when the user picks a date/time and what date time they select. So I’m listening for the `calendly.date_and_time_selected` event, which is correctly fired when an time is selected. However, the payload is empty, so while I know the user picked a date, I have no idea WHICH date.

 

Is there any workaround or fix for this?

 

Here’s a code snippet:

 

      function initCalendly() {
Calendly.initInlineWidget({
url: 'https://calendly.com/example/meet?embed_domain=example.com',
parentElement: document.getElementById('calendly-embed')
});
}

// Load Calendly after page load
window.addEventListener('load', initCalendly);

function isCalendlyEvent(e) {
return e.origin === 'https://calendly.com' && e.data.event?.startsWith('calendly.');
}

window.addEventListener('message', function (e) {
if (isCalendlyEvent(e)) {

switch (e.data.event) {
case 'calendly.date_and_time_selected':
console.log('Date and Time Selected:', e);

//Uh oh e.data.payload is empty!

}
}
});
</script>

 

Be the first to reply!