> ## Documentation Index
> Fetch the complete documentation index at: https://help.dingtalk.io/llms.txt
> Use this file to discover all available pages before exploring further.

# DateField 日期选择

> DateField 日期选择组件文档，介绍日期格式与取值范围等属性配置，通过弹出面板录入具体日期。

## 何时使用

* 输入或选择具体时间，当用户需要输入一个日期，可以点击标准输入框，弹出日期面板进行选择。

## 组件示例

<iframe src="https://www.aliwork.com/developer/date-field-v2?isRenderNav=false" width="100%" height="480" frameBorder="0" />

## 组件属性

| 属性                 | 说明                                                              | 类型                                                                                 | 默认值            |
| ------------------ | --------------------------------------------------------------- | ---------------------------------------------------------------------------------- | -------------- |
| `behavior`         | 表单组件显示状态                                                        | [Behavior](/zh/open/yida/components/interface#behavior)                            | `'NORMAL'`     |
| `disabledDate`     | 自定义限制，当**type**属性为custom时生效                                     | `(current: number)=> boolean`                                                      | -              |
| `end`              | 日期结束时间，当**type**属性为duration时生效                                  | `number`                                                                           | -              |
| `format`           | 日期格式                                                            | `'YYYY' \| 'YYYY-MM' \| 'YYYY-MM-DD'\| 'YYYY-MM-DD HH:mm'\| 'YYYY-MM-DD HH:mm:ss'` | `'YYYY-MM-DD'` |
| `hasClear`         | 是否有清除按钮                                                         | `boolean`                                                                          | `true`         |
| `label`            | 表单组件标题                                                          | `string`                                                                           | -              |
| `labelAlign`       | 表单组件标题的位置                                                       | `'left' \| 'top'`                                                                  | `'top'`        |
| `labelColOffset`   | 设置标题的偏移位置，配置值为栅格值，1代表1/24                                       | `number`                                                                           | `0`            |
| `labelColSpan`     | 设置标题的占位宽度，配置值为栅格值，1代表1/24                                       | `number`                                                                           | `4`            |
| `labelTextAlign`   | 表单组件的标题对齐方式                                                     | `'left' \| 'right'`                                                                | `'right'`      |
| `labelTipsIcon`    | 表单组件标题提示信息入口图标，当labelTipsTypes取值为 **text** 或 **render** 时生效     | `string`                                                                           | -              |
| `labelTipsRender`  | 表单组件标题提示信息自定义渲染方法，当labelTipsTypes取值为 **render** 时生效             | `(props: IComponentProps) => ReactNode`                                            | -              |
| `labelTipsText`    | 表单组件标题提示文本信息，当labelTipsTypes取值为 **text** 时生效                    | `string`                                                                           | -              |
| `labelTipsTypes`   | 表单组件标题提示信息类型设置                                                  | [LabelTipsTypes](/zh/open/yida/components/interface#labelTipsTypes)                | `'none'`       |
| `onChange`         | 组件值发生改变事件                                                       | `({value: number})=> void`                                                         | -              |
| `onOk`             | 点击确认时触发事件                                                       | `({value: number})=> void`                                                         | -              |
| `onVisibleChange`  | 弹层显示或隐藏时触发事件                                                    | `(visible: boolean) => void`                                                       | -              |
| `placeholder`      | 占位提示                                                            | `string`                                                                           | `'请选择'`        |
| `resetTime`        | 是否每次选择日期时重置时间                                                   | `boolean`                                                                          | `false`        |
| `returnType`       | 日期返回类型                                                          | `'timestamp' \| 'string' \| 'moment'`                                              | `'timestamp'`  |
| `size`             | 表单组件尺寸                                                          | [Size](/zh/open/yida/components/interface#size)                                    | `'medium'`     |
| `start`            | 日期开始时间， 当**type**属性为duration时生效                                 | `number`                                                                           | -              |
| `tips`             | 表单组件描述信息，展示在控件下方                                                | `string`                                                                           | -              |
| `type`             | 时间限制范围                                                          | `'none' \| 'beforeToday' \| 'afterToday'\| 'duration'\| 'custom'`                  | `'none'`       |
| `validation`       | 表单组件校验设置，具体使用详见[表单校验文档](/zh/open/yida/guide/concept/validation) | [Validation\[\]](/zh/open/yida/components/interface#validation)                    | `[]`           |
| `value`            | 日期选择默认值                                                         | `number`                                                                           | -              |
| `wrapperColOffset` | 设置表单组件的偏移位置，设置值为栅格值，1代表1/24                                     | `number`                                                                           | `0`            |
| `wrapperColSpan`   | 设置表单组件的占位宽度，设置值为栅格值，1代表1/24                                     | `number`                                                                           | `0`            |
