fix: undefined year, month, day values on postgres statistics

This commit is contained in:
Julian Krauser 2025-02-10 10:29:51 +01:00
parent eb9139dbd0
commit c984d1ef2f

View file

@ -4,7 +4,7 @@ export default abstract class DateMappingHelper {
static mapDate(entry: any) { static mapDate(entry: any) {
switch (DB_TYPE) { switch (DB_TYPE) {
case "postgres": case "postgres":
return `${entry.years} years ${entry.months} months ${entry.days} days`; return `${entry?.years ?? 0} years ${entry?.months ?? 0} months ${entry?.days ?? 0} days`;
case "mysql": case "mysql":
return entry.toString(); return entry.toString();
case "sqlite": case "sqlite":