fix(db): clickhouse dates (unsure what have happen)
This commit is contained in:
@@ -183,17 +183,10 @@ export function formatClickhouseDate(
|
|||||||
date: Date | string,
|
date: Date | string,
|
||||||
skipTime = false,
|
skipTime = false,
|
||||||
): string {
|
): string {
|
||||||
if (typeof date === 'string') {
|
|
||||||
if (skipTime) {
|
|
||||||
return date.slice(0, 10);
|
|
||||||
}
|
|
||||||
return date.slice(0, 19).replace('T', ' ');
|
|
||||||
}
|
|
||||||
|
|
||||||
if (skipTime) {
|
if (skipTime) {
|
||||||
return date.toISOString().split('T')[0]!;
|
return new Date(date).toISOString().split('T')[0]!;
|
||||||
}
|
}
|
||||||
return date.toISOString().replace('T', ' ').replace(/Z+$/, '');
|
return new Date(date).toISOString().replace('T', ' ').replace(/Z+$/, '');
|
||||||
}
|
}
|
||||||
|
|
||||||
export function toDate(str: string, interval?: IInterval) {
|
export function toDate(str: string, interval?: IInterval) {
|
||||||
|
|||||||
@@ -100,7 +100,8 @@ const getPrismaClient = () => {
|
|||||||
return org.subscriptionEndsAt;
|
return org.subscriptionEndsAt;
|
||||||
}
|
}
|
||||||
|
|
||||||
return new Date();
|
// Hedge against edge cases :D
|
||||||
|
return new Date(Date.now() + 1000 * 60 * 60 * 24);
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
isTrial: {
|
isTrial: {
|
||||||
|
|||||||
Reference in New Issue
Block a user