© 2026 Hedgehog Software, LLC
createInsertSchema
completedAt
startedAt
export const Test = pgTable('test', { startedAt: timestamp(timezoneConfig).defaultNow().notNull(), completedAt: timestamp(timezoneConfig), }) const schema = z .object({ startedAt: z.date().max(new Date()), completedAt: z.date().max(new Date()).optional() }) .refine( ({ startedAt, completedAt }) => { if (completedAt == null) return true return completedAt > startedAt }, () => ({ path: ['startedAt', 'completedAt'], message: 'completed date at must be after started date' }) )