# date

Creates a date schema.

```ts
const Schema = v.date<TMessage>(message);
```

## Generics

- `TMessage` <Property {...properties.TMessage} />

## Parameters

- `message` <Property {...properties.message} />

### Explanation

With `date` you can validate the data type of the input. If the input is not a date, you can use `message` to customize the error message.

## Returns

- `Schema` <Property {...properties.Schema} />

## Examples

The following examples show how `date` can be used.

### Force minimum

Schema that forces a minimum date of today.

```ts
const MinDateSchema = v.pipe(v.date(), v.toMinValue(new Date()));
```

### Validate range

Schema that validates a date in a range.

```ts
const DateRangeSchema = v.pipe(
  v.date(),
  v.minValue(new Date(2019, 0, 1)),
  v.maxValue(new Date(2020, 0, 1))
);
```

## Related

The following APIs can be combined with `date`.

### Schemas

<ApiList
  items={[
    'array',
    'exactOptional',
    'intersect',
    'lazy',
    'looseObject',
    'looseTuple',
    'map',
    'nonNullable',
    'nonNullish',
    'nonOptional',
    'nullable',
    'nullish',
    'object',
    'objectWithRest',
    'optional',
    'record',
    'set',
    'strictObject',
    'strictTuple',
    'tuple',
    'tupleWithRest',
    'undefinedable',
    'union',
  ]}
/>

### Methods

<ApiList
  items={[
    'assert',
    'config',
    'fallback',
    'getDefault',
    'getDefaults',
    'getFallback',
    'getFallbacks',
    'is',
    'message',
    'parse',
    'parser',
    'pipe',
    'safeParse',
    'safeParser',
  ]}
/>

### Actions

<ApiList
  items={[
    'check',
    'brand',
    'description',
    'flavor',
    'gtValue',
    'guard',
    'ltValue',
    'maxValue',
    'metadata',
    'minValue',
    'notValue',
    'notValues',
    'rawCheck',
    'rawTransform',
    'readonly',
    'title',
    'toMaxValue',
    'toMinValue',
    'transform',
    'value',
    'values',
  ]}
/>

### Utils

<ApiList items={['entriesFromList', 'isOfKind', 'isOfType']} />
