2025-02-08 09:00:50 +01:00
|
|
|
import { DB_TYPE } from "../../../../env.defaults";
|
|
|
|
|
|
|
|
export default abstract class DateMappingHelper {
|
|
|
|
static mapDate(entry: any) {
|
|
|
|
switch (DB_TYPE) {
|
|
|
|
case "postgres":
|
2025-02-10 10:29:51 +01:00
|
|
|
return `${entry?.years ?? 0} years ${entry?.months ?? 0} months ${entry?.days ?? 0} days`;
|
2025-02-08 09:00:50 +01:00
|
|
|
case "mysql":
|
|
|
|
return entry.toString();
|
|
|
|
case "sqlite":
|
|
|
|
return entry;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|