---
title: isDate
nav:
  title: Tools
  path: /tools
group:
  title: Types
toc: content
---

## isDate

Demo:

```tsx
/**
 * title: 基础用法
 * description: 判断是否为 Date 类型函数
 */

import React from 'react';
import { isDate } from 'aim-tools';

const result1 = isDate(new Date());
const result2 = isDate('2023-04-18');

export default () => (
  <pre>
    <code>
      isDate(new Date()); // {result1.toString()}
      <br />
      <br />
      isDate('2023-04-18'); // {result2.toString()}
    </code>
  </pre>
);
```

### API

```typescript
isDate(date: any);
```

### Params

| 参数 | 说明           | 类型 | 默认值 | 必填 |
| :--- | :------------- | :--- | :----- | :--- |
| date | 需要判断的数据 | any  | -      | 是   |

### Returns

| 返回值 | 说明                     |
| :----- | :----------------------- |
| true   | 该数据是 Date 类型数据   |
| false  | 该数据不是 Date 类型数据 |
