Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Docs
提交
002b248c
D
Docs
项目概览
OpenHarmony
/
Docs
大约 2 年 前同步成功
通知
161
Star
293
Fork
28
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
D
Docs
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
002b248c
编写于
3月 19, 2022
作者:
E
esterzhou
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
update doc
Signed-off-by:
N
esterzhou
<
ester.zhou@huawei.com
>
上级
e97fc035
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
20 addition
and
20 deletion
+20
-20
en/application-dev/reference/arkui-ts/ts-basic-components-datepicker.md
...-dev/reference/arkui-ts/ts-basic-components-datepicker.md
+20
-20
未找到文件。
en/application-dev/reference/arkui-ts/ts-basic-components-datepicker.md
浏览文件 @
002b248c
# DatePicker
# DatePicker
>  **NOTE
:
**
>  **NOTE**
> This component is supported since API version 8. Updates will be marked with a superscript to indicate their earliest API version.
> This component is supported since API version 8. Updates will be marked with a superscript to indicate their earliest API version.
...
@@ -25,42 +25,42 @@ DatePicker(value:{start?: Date, end?: Date, selected?: Date, type?: DatePickerTy
...
@@ -25,42 +25,42 @@ DatePicker(value:{start?: Date, end?: Date, selected?: Date, type?: DatePickerTy
Creates a date picker that allows users to select a date or time within the specified range.
Creates a date picker that allows users to select a date or time within the specified range.
-
Parameters
-
Parameters
| Name | Type | Mandatory | Default
Value | Description |
| Name | Type | Mandatory | Default
Value | Description |
| -------- | -------- | -------- | -------- | -------- |
| -------- | -------- | -------- | -------- | -------- |
| start | Date | No | Date('1970-1-1') | Start
date
of
the
date
picker. |
| start | Date | No | Date('1970-1-1') | Start
date
of
the
date
picker. |
| end | Date | No | Date('2100-12-31') | End
date
of
the
date
picker. |
| end | Date | No | Date('2100-12-31') | End
date
of
the
date
picker. |
| selected | Date | No | Current
system
date
or
time | Selected
date
when
**type**
is
set
to
**DatePickerType.Date**
and
selected
time
when
**type**
is
set
to
**DatePickerType.Time**
. |
| selected | Date | No | Current
system
date
or
time | Selected
date
when
**type**
is
set
to
**DatePickerType.Date**
and
selected
time
when
**type**
is
set
to
**DatePickerType.Time**
. |
| type | DatePickerType | No | DatePickerType.Date | Picker
type,
which
can
be
date
picker
and
time
picker.
The
date
picker
is
used
by
default. |
| type | DatePickerType | No | DatePickerType.Date | Picker
type,
which
can
be
date
picker
and
time
picker.
The
date
picker
is
used
by
default. |
-
DatePickerType enums
-
DatePickerType enums
| Name | Description |
| Name | Description |
| -------- | -------- |
| -------- | -------- |
| Date | Date
picker. |
| Date | Date
picker. |
| Time | Time
picker. |
| Time | Time
picker. |
## Attributes
## Attributes
| Name | Type | Default
Value | Description |
| Name | Type | Default
Value | Description |
| -------- | -------- | -------- |-------- |
| -------- | -------- | -------- |-------- |
| lunar | boolean | false | Whether
to
display
the
lunar
calendar.
<br/>
-
**true**:
The
lunar
calendar
is
displayed.
<br/>
-
**false**:
The
lunar
calendar
is
not
displayed. |
| lunar | boolean | false | Whether
to
display
the
lunar
calendar.
<br/>
-
**true**:
The
lunar
calendar
is
displayed.
<br/>
-
**false**:
The
lunar
calendar
is
not
displayed. |
| useMilitaryTime | boolean | false | Whether
the
display
time
is
in
24-hour
format.
|
| useMilitaryTime | boolean | false | Whether
the
display
time
is
in
24-hour
format.
The value cannot be dynamically modified. |
## Events
## Events
| Name | Description |
| Name | Description |
| -------- | -------- |
| -------- | -------- |
| onChange(callback:
(value:
DatePickerResult)
=
>
void) | This
event
is
triggered
when
a
date
or
time
is
selected. |
| onChange(callback:
(value:
DatePickerResult)
=
>
void) | This
event
is
triggered
when
a
date
or
time
is
selected. |
-
DatePickerResult object description
-
DatePickerResult object description
| Name | Type | Description |
| Name | Type | Description |
| -------- | -------- | -------- |
| -------- | -------- | -------- |
| year | number | Year
of
the
selected
date
(when
**type**
is
**DatePickerType.Date**
). |
| year | number | Year
of
the
selected
date
(when
**type**
is
**DatePickerType.Date**
). |
| month | number | Month
of
the
selected
date
(when
**type**
is
**DatePickerType.Date**
). |
| month | number | Month
of
the
selected
date
(when
**type**
is
**DatePickerType.Date**
). |
| day | number | Date
of
the
selected
date
(when
**type**
is
**DatePickerType.Date**
). |
| day | number | Date
of
the
selected
date
(when
**type**
is
**DatePickerType.Date**
). |
| hour | number | Hour
portion
of
the
selected
time
(when
**type**
is
**DatePickerType.Time**
). |
| hour | number | Hour
portion
of
the
selected
time
(when
**type**
is
**DatePickerType.Time**
). |
| minute | number | Minute
portion
of
the
selected
time
(when
**type**
is
**DatePickerType.Time**
). |
| minute | number | Minute
portion
of
the
selected
time
(when
**type**
is
**DatePickerType.Time**
). |
## Example
## Example
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录