mirror of
https://github.com/formbricks/formbricks.git
synced 2026-02-05 10:36:06 -06:00
18 lines
487 B
TypeScript
18 lines
487 B
TypeScript
import "server-only";
|
|
|
|
import { TSession } from "@formbricks/types/sessions";
|
|
|
|
export const formatSessionDateFields = (session: TSession): TSession => {
|
|
if (typeof session.createdAt === "string") {
|
|
session.createdAt = new Date(session.createdAt);
|
|
}
|
|
if (typeof session.updatedAt === "string") {
|
|
session.updatedAt = new Date(session.updatedAt);
|
|
}
|
|
if (typeof session.expiresAt === "string") {
|
|
session.expiresAt = new Date(session.expiresAt);
|
|
}
|
|
|
|
return session;
|
|
};
|