Using Schema.Date with Date Objects Instead of Strings

Is there a way to make Schema.Date expect a Date instead of a string, I'm using schema together with drizzle which by default returns dates for timestamps, I then pass with Schema.Struct({...., createdAt: Schema.Date})
However that errors because type Date is not assignable to type string.

Drizzle has the {mode: 'string'} options for timestamps, however then, when I write to the database, I always have to call .toIsoString on all my dates, because throughout my application I use dates and not strings.

So my ideal scenario would be a DateToDate decoding and encoding
Was this page helpful?