Removed custom date format. Use ISO string everywhere.

This commit is contained in:
Mike Cao 2024-08-13 22:16:21 -07:00
parent 0bd57bb158
commit 04de691893
7 changed files with 7 additions and 25 deletions

View file

@ -136,9 +136,9 @@ async function clickhouseQuery(data: {
...args
} = data;
const { insert } = clickhouse;
const { getDateFormat, sendMessage } = kafka;
const { sendMessage } = kafka;
const eventId = uuid();
const createdAt = getDateFormat(new Date());
const createdAt = new Date().toISOString();
const message = {
...args,

View file

@ -61,7 +61,7 @@ async function clickhouseQuery(data: {
const { websiteId, sessionId, eventId, urlPath, eventName, eventData, createdAt } = data;
const { insert } = clickhouse;
const { getDateFormat, sendMessages } = kafka;
const { sendMessages } = kafka;
const jsonKeys = flattenJSON(eventData);
@ -76,7 +76,7 @@ async function clickhouseQuery(data: {
data_type: dataType,
string_value: getStringValue(value, dataType),
number_value: dataType === DATA_TYPE.number ? value : null,
date_value: dataType === DATA_TYPE.date ? getDateFormat(value) : null,
date_value: dataType === DATA_TYPE.date ? value?.toISOString() : null,
created_at: createdAt,
};
});

View file

@ -81,8 +81,8 @@ async function clickhouseQuery(data: {
const { websiteId, sessionId, sessionData } = data;
const { insert } = clickhouse;
const { getDateFormat, sendMessages } = kafka;
const createdAt = getDateFormat(new Date());
const { sendMessages } = kafka;
const createdAt = new Date().toISOString();
const jsonKeys = flattenJSON(sessionData);
@ -94,7 +94,7 @@ async function clickhouseQuery(data: {
data_type: dataType,
string_value: getStringValue(value, dataType),
number_value: dataType === DATA_TYPE.number ? value : null,
date_value: dataType === DATA_TYPE.date ? getDateFormat(value) : null,
date_value: dataType === DATA_TYPE.date ? value?.toISOString() : null,
created_at: createdAt,
};
});