From 34f06002eb39291cc9cbd53b2b0c3963d5d6d291 Mon Sep 17 00:00:00 2001 From: Sun_sun <469361609@qq.com> Date: Fri, 10 Oct 2025 17:25:49 +0800 Subject: [PATCH] =?UTF-8?q?2025-10-10=20=E6=97=B6=E9=97=B4=E8=BE=93?= =?UTF-8?q?=E5=87=BA=E6=A0=BC=E5=BC=8F=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/entity/program.entity.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/entity/program.entity.ts b/src/entity/program.entity.ts index 608cdae..9ad3462 100644 --- a/src/entity/program.entity.ts +++ b/src/entity/program.entity.ts @@ -77,7 +77,11 @@ export class ProgramEntity { name: "create_date", nullable: true, comment: "发布时间", - default: () => "CURRENT_TIMESTAMP" + default: () => "CURRENT_TIMESTAMP", + transformer: { + to: (value: Date) => value, + from: (value: string) => value ? format(value, "yyyy-MM-dd") : null + } }) createDate: Date | null;