mirror of
https://github.com/documenso/documenso.git
synced 2025-11-13 16:23:06 +10:00
🚸date field format
This commit is contained in:
@ -82,13 +82,26 @@ async function postHandler(req: NextApiRequest, res: NextApiResponse) {
|
|||||||
documentWithInserts = await insertTextInPDF(
|
documentWithInserts = await insertTextInPDF(
|
||||||
documentWithInserts,
|
documentWithInserts,
|
||||||
field.type === FieldType.DATE
|
field.type === FieldType.DATE
|
||||||
? new Date().toDateString()
|
? new Intl.DateTimeFormat("en-US", {
|
||||||
|
month: "long",
|
||||||
|
day: "numeric",
|
||||||
|
year: "numeric",
|
||||||
|
}).format(new Date())
|
||||||
: field.customText || "",
|
: field.customText || "",
|
||||||
field.positionX,
|
field.positionX,
|
||||||
field.positionY,
|
field.positionY,
|
||||||
field.page,
|
field.page,
|
||||||
false
|
false
|
||||||
);
|
);
|
||||||
|
|
||||||
|
await prisma.field.update({
|
||||||
|
where: {
|
||||||
|
id: field.id,
|
||||||
|
},
|
||||||
|
data: {
|
||||||
|
inserted: true,
|
||||||
|
},
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
await prisma.document.update({
|
await prisma.document.update({
|
||||||
|
|||||||
Reference in New Issue
Block a user