mirror of
https://github.com/kremalicious/umami.git
synced 2025-02-06 01:15:42 +01:00
Fixed date value for properties.
This commit is contained in:
parent
10239fefcd
commit
5aba9acb81
@ -49,7 +49,7 @@ function getClient() {
|
|||||||
return client;
|
return client;
|
||||||
}
|
}
|
||||||
|
|
||||||
function getUTCString(date?: Date) {
|
function getUTCString(date?: Date | string | number) {
|
||||||
return formatInTimeZone(date || new Date(), 'UTC', 'yyyy-MM-dd HH:mm:ss');
|
return formatInTimeZone(date || new Date(), 'UTC', 'yyyy-MM-dd HH:mm:ss');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -60,7 +60,7 @@ async function clickhouseQuery(data: {
|
|||||||
}) {
|
}) {
|
||||||
const { websiteId, sessionId, eventId, urlPath, eventName, eventData, createdAt } = data;
|
const { websiteId, sessionId, eventId, urlPath, eventName, eventData, createdAt } = data;
|
||||||
|
|
||||||
const { insert } = clickhouse;
|
const { insert, getUTCString } = clickhouse;
|
||||||
const { sendMessages } = kafka;
|
const { sendMessages } = kafka;
|
||||||
|
|
||||||
const jsonKeys = flattenJSON(eventData);
|
const jsonKeys = flattenJSON(eventData);
|
||||||
@ -76,7 +76,7 @@ async function clickhouseQuery(data: {
|
|||||||
data_type: dataType,
|
data_type: dataType,
|
||||||
string_value: getStringValue(value, dataType),
|
string_value: getStringValue(value, dataType),
|
||||||
number_value: dataType === DATA_TYPE.number ? value : null,
|
number_value: dataType === DATA_TYPE.number ? value : null,
|
||||||
date_value: dataType === DATA_TYPE.date ? value?.toISOString() : null,
|
date_value: dataType === DATA_TYPE.date ? getUTCString(value) : null,
|
||||||
created_at: createdAt,
|
created_at: createdAt,
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
|
@ -94,7 +94,7 @@ async function clickhouseQuery(data: {
|
|||||||
data_type: dataType,
|
data_type: dataType,
|
||||||
string_value: getStringValue(value, dataType),
|
string_value: getStringValue(value, dataType),
|
||||||
number_value: dataType === DATA_TYPE.number ? value : null,
|
number_value: dataType === DATA_TYPE.number ? value : null,
|
||||||
date_value: dataType === DATA_TYPE.date ? value?.toISOString() : null,
|
date_value: dataType === DATA_TYPE.date ? getUTCString(value) : null,
|
||||||
created_at: createdAt,
|
created_at: createdAt,
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
|
Loading…
Reference in New Issue
Block a user