I haven't been able to find documentation on this, so here I am StackOverflow.
I have an interface that I want to convert and use in io-ts' run-time validation. This interface includes a field with type Date on it. I've looked through the rest of the commands on t when importing io-ts as t and I can't find a way to validate that it's a date
Ex:
export interface Transaction {
transactionDate: Date,
phrase: string
}
How do I convert this into a type using io-ts? Ideally it would be something like this
export const Transaction = t.type({
transactionDate: t.date,
phrase: t.string
})
The only thing that I've found that works is setting the Date as type t.string, but that would let any kind of string through.