mirror of
https://github.com/umami-software/umami.git
synced 2026-02-09 07:07:17 +01:00
Removed custom date format. Use ISO string everywhere.
This commit is contained in:
parent
0bd57bb158
commit
04de691893
7 changed files with 7 additions and 25 deletions
|
|
@ -1,5 +1,4 @@
|
|||
import { ClickHouseClient, createClient } from '@clickhouse/client';
|
||||
import dateFormat from 'dateformat';
|
||||
import debug from 'debug';
|
||||
import { CLICKHOUSE } from 'lib/db';
|
||||
import { DEFAULT_PAGE_SIZE, OPERATORS } from './constants';
|
||||
|
|
@ -63,10 +62,6 @@ function getDateSQL(field: string, unit: string, timezone?: string) {
|
|||
return `date_trunc('${unit}', ${field})`;
|
||||
}
|
||||
|
||||
function getDateFormat(date: Date) {
|
||||
return `'${dateFormat(date, 'UTC:yyyy-mm-dd HH:MM:ss')}'`;
|
||||
}
|
||||
|
||||
function mapFilter(column: string, operator: string, name: string, type: string = 'String') {
|
||||
const value = `{${name}:${type}}`;
|
||||
|
||||
|
|
@ -224,7 +219,6 @@ export default {
|
|||
connect,
|
||||
getDateStringSQL,
|
||||
getDateSQL,
|
||||
getDateFormat,
|
||||
getFilterQuery,
|
||||
parseFilters,
|
||||
pagedQuery,
|
||||
|
|
|
|||
|
|
@ -1,4 +1,3 @@
|
|||
import dateFormat from 'dateformat';
|
||||
import debug from 'debug';
|
||||
import { Kafka, Mechanism, Producer, RecordMetadata, SASLOptions, logLevel } from 'kafkajs';
|
||||
import { KAFKA, KAFKA_PRODUCER } from 'lib/db';
|
||||
|
|
@ -56,10 +55,6 @@ async function getProducer(): Promise<Producer> {
|
|||
return producer;
|
||||
}
|
||||
|
||||
function getDateFormat(date: Date, format?: string): string {
|
||||
return dateFormat(date, format ? format : 'UTC:yyyy-mm-dd HH:MM:ss');
|
||||
}
|
||||
|
||||
async function sendMessage(
|
||||
topic: string,
|
||||
message: { [key: string]: string | number },
|
||||
|
|
@ -107,7 +102,6 @@ export default {
|
|||
producer,
|
||||
log,
|
||||
connect,
|
||||
getDateFormat,
|
||||
sendMessage,
|
||||
sendMessages,
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue