Allow more specific "date" keywords
Support type.keywords.date.only (i.e. "only a date without the time like "YYYY-MM-DD")
🤷 Motivation
In our project we use a generator that can convert swagger files to zod types. I would love to migrate this to arktype as it sounds very promising.
But I noticed that some of the swagger formats aren't currently supported out of the box. For example we distinguish between z.optional(z.string().datetime({ local: true, offset: true }) (I guess that's equivalent to type.keywords.string.date.iso.root?) and z.optional(z.string().date()) (only allowing "YYYY-MM-DD")
💡 Solution
It would be great to be able to define what kind of date we allow, especially the ones which can already be defined via swagger:
- date – full-date notation as defined by RFC 3339, section 5.6, for example, 2017-07-21
- date-time – the date-time notation as defined by RFC 3339, section 5.6, for example, 2017-07-21T17:32:28Z
NOTE: I don't want to parse it to date. I keep this as string (eventually being parsed to dayjs later on)