diff --git a/rudder-client-javascript/analytics/integrations/HubSpot/browser.js b/rudder-client-javascript/analytics/integrations/HubSpot/browser.js index f2177dd7f..ffbc3c7b4 100644 --- a/rudder-client-javascript/analytics/integrations/HubSpot/browser.js +++ b/rudder-client-javascript/analytics/integrations/HubSpot/browser.js @@ -23,10 +23,15 @@ class HubSpot { for (let k in traits) { if (!!Object.getOwnPropertyDescriptor(traits, k) && traits[k]) { let hubspotkey = k;//k.startsWith("rl_") ? k.substring(3, k.length) : k; - traitsValue[hubspotkey] = traits[k]; + if(toString.call(traits[k]) == '[object Date]'){ + traitsValue[hubspotkey] = traits[k].getTime(); + } else { + traitsValue[hubspotkey] = traits[k]; + } } + } - if (traitsValue["address"]) { + /* if (traitsValue["address"]) { let address = traitsValue["address"]; //traitsValue.delete(address) delete traitsValue["address"]; @@ -37,7 +42,7 @@ class HubSpot { traitsValue[hubspotkey] = address[k]; } } - } + } */ let userProperties = rudderElement.message.context.user_properties; for (let k in userProperties) { if (