Hi there,
I'm working with complex dates, because our app requires timezone dependent functionality.
So I have custom transformations like this one:
startDate: z.string().transform(date => DateTime.fromFormat(date, 'yyyy-MM-dd')),
Expected scenario
startDate is serialized like: '2025-01-01'
What actually happens
Transformation already runs on the client side and calls the toString() function of DateTime leading to a serialized string value of "2025-01-01T00:00:00+1"
Zod makes a distinction between input and output types, the transformation should only occur on the backend. React-hook-forms supports this like this: https://github.com/orgs/react-hook-form/discussions/8496#discussioncomment-8800129