core-utils
    Preparing search index...
    • Validates datetime inputs and normalizes them to Date objects.

      Accepts:

      • ISO-8601 datetime strings (validated strictly)
      • Date objects (passed through as-is)

      Rejects epoch numbers, date-only strings, and other loose inputs.

      Composable with .optional(), .nullable(), etc. at the call site:

      z.object({
      start: dateTimeSchema(),
      clockIn: dateTimeSchema().optional(),
      });

      z.input → string | Date z.output → Date

      Returns ZodEffects<ZodUnion<[ZodString, ZodDate]>, Date, string | Date>