ff-admin-server/src/factory/admin/club/member/dateMappingHelper.ts

15 lines
387 B
TypeScript
Raw Normal View History

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":
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;
}
}
}