fix: correctly set new date (#19766)

This commit is contained in:
Marc Roig 2024-03-13 22:21:20 +01:00 committed by GitHub
parent d87468f098
commit d9f9c0cd21
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -68,11 +68,8 @@ const enableDraftAndPublish = async ({ oldContentTypes, contentTypes }: Input) =
return qb.raw('NULL as published_at');
}
// TODO: Find a way to insert a date using the correct format
// Before: 1710240975246
// With qb.fn.now(): 2021-10-24 09:52:46
if (att === 'updated_at') {
return qb.raw(`?? as updated_at`, [qb.fn.now()]);
return qb.raw(`? as updated_at`, [new Date()]);
}
return att;