Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: add date time support to hs #3906

Open
wants to merge 7 commits into
base: develop
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions src/v0/destinations/hs/util.js
Original file line number Diff line number Diff line change
Expand Up @@ -237,6 +237,8 @@
let propValue = isNull(traits[traitsKey]) ? '' : traits[traitsKey];
if (propertyMap[hsSupportedKey] === 'date') {
propValue = getUTCMidnightTimeStampValue(propValue);
} else if (propertyMap[hsSupportedKey] === 'datetime') {
propValue = new Date(propValue).getTime();

Check warning on line 241 in src/v0/destinations/hs/util.js

View check run for this annotation

Codecov / codecov/patch

src/v0/destinations/hs/util.js#L241

Added line #L241 was not covered by tests
}

rawPayload[hsSupportedKey] = validatePayloadDataTypes(
Expand Down Expand Up @@ -828,6 +830,8 @@
const value = populatedTraits[key];
if (propertyToTypeMap[key] === 'date') {
populatedTraits[key] = getUTCMidnightTimeStampValue(value);
} else if (propertyToTypeMap[key] === 'datetime') {
populatedTraits[key] = new Date(value).getTime();

Check warning on line 834 in src/v0/destinations/hs/util.js

View check run for this annotation

Codecov / codecov/patch

src/v0/destinations/hs/util.js#L834

Added line #L834 was not covered by tests
}
});

Expand Down
Loading