From a476023ed7d096c9c70b57bc56ced750d053747b Mon Sep 17 00:00:00 2001 From: liuyihai2002 Date: Mon, 12 Jan 2026 19:19:39 +0800 Subject: [PATCH] =?UTF-8?q?docs:=20=E6=96=B0=E5=A2=9Ereact-native-communit?= =?UTF-8?q?y/datetimepicker=200.82=E6=A1=86=E6=9E=B6=E9=80=82=E9=85=8D?= =?UTF-8?q?=E8=AF=B4=E6=98=8E?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: liuyihai2002 --- en/react-native-community-datetimepicker.md | 26 ++++++++++++------- .../react-native-community-datetimepicker.md | 10 ++++--- 2 files changed, 24 insertions(+), 12 deletions(-) diff --git a/en/react-native-community-datetimepicker.md b/en/react-native-community-datetimepicker.md index 544b2842..244460a8 100644 --- a/en/react-native-community-datetimepicker.md +++ b/en/react-native-community-datetimepicker.md @@ -22,6 +22,7 @@ Please refer to the Release page of the corresponding third-party library for ve | <= 7.6.2-0.1.1@deprecated | [@react-native-oh-tpl/datetimepicker Releases(deprecated)](https://github.com/react-native-oh-library/datetimepicker/releases) | 0.72 | | 7.6.3 | [@react-native-ohos/datetimepicker Releases](https://gitcode.com/openharmony-sig/rntpc_datetimepicker/releases) | 0.72 | | 8.4.3 | [@react-native-ohos/datetimepicker Releases](https://gitcode.com/openharmony-sig/rntpc_datetimepicker/releases) | 0.77 | +| 8.6.1 | [@react-native-ohos/datetimepicker Releases](https://gitcode.com/openharmony-sig/rntpc_datetimepicker/releases) | 0.82 | For older versions that are not published to npm, please refer to the [installation guide](/en/tgz-usage-en.md) to install the tgz package. @@ -104,6 +105,7 @@ export const MDatetimepicker = () => { | | Is supported autolink | Supported RN Version | |--------------------------------------|-----------------------|----------------------| +| ~8.6.1 | No | 0.82 | | ~8.4.3 | No | 0.77 | | ~7.6.3 | Yes | 0.72 | | <= 7.6.2-0.1.1@deprecated | No | 0.72 | @@ -282,6 +284,7 @@ Verified in the following versions. 1. RNOH: 0.72.96; SDK: HarmonyOS 6.0.0 Release SDK; IDE: DevEco Studio 6.0.0.858; ROM: 6.0.0.112; 2. RNOH: 0.72.33; SDK: HarmonyOS NEXT B1; IDE: DevEco Studio: 5.0.3.900; ROM: Next.0.0.71; 3. RNOH: 0.77.18; SDK: HarmonyOS 6.0.0 Release SDK; IDE: DevEco Studio 6.0.0.858; ROM: 6.0.0.112; +4. RNOH: 0.82.1; SDK: HarmonyOS 6.0.1 Release SDK; IDE: DevEco Studio 6.0.1 Release; ROM:6.0.0.120 SP7 ## Properties @@ -293,16 +296,20 @@ Verified in the following versions. | Name | Description | Type | Required | Platform | HarmonyOS Support | |-------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|----------|----------|--------------------------|-----------------------------------------------------------| -| mode | Defines the type of the picker | string | No | All | partially (仅支持 date/time 模式) | +| mode | Defines the type of the picker | string | No | All | partially (only supports date/time modes) | | style | Sets style directly on picker component. | object | No | IOS only | yes | -| display | Defines the visual display of the picker. The default value is "default". | string | No | All | partially (支持"default",
"spinner","compact","inline") | -| onChange | Date change handler. | function | No | All | partially (仅支持 type 为 set 类型) | -| value | Defines the date or time value used in the component. | Date | Yes | All | partially (仅 mode=date 且
display=spinner 时支持动态设置) | -| is24Hour | Allows changing of the time picker to a 24-hour format. | bool | No | Windows and Android only | yes | -| maximumDate | Defines the maximum date that can be selected | Date | No | All | partially (仅支持在 mode=date 且
display=spinner 时设置) | -| minimumDate | Defines the minimum date that can be selected. | Date | No | All | partially (仅支持在 mode=date 且
display=spinner 时设置) | -| disabled | If true, the user won't be able to interact with the view. | bool | No | IOS only | yes | -| textColor | Allows changing of the textColor of the date picker. | string | No | IOS only | partially (仅支持在 mode=date 且
display=compact 时设置) | +| display | Defines the visual display of the picker. The default value is "default". | string | No | All | partially (supports "default",
"spinner", "compact", "inline") | +| design | Defines whether the picker should use Material 3 components or the default picker. The default value is "default". | string | No | Android only | No | +| initialInputMode | Only takes effect when design is "material". Allows setting the initial input mode of the picker. | string | No | Android only | No | +| title | Only takes effect when design is "material". Allows setting the title of the picker dialog. | string | No | Android only | No | +| fullscreen | Only takes effect when design is "material". Allows setting the date picker dialog to display in fullscreen. | boolean | No | Android only | No | +| onChange | Date change handler. | function | No | All | partially (only supports event type 'set') | +| value | Defines the date or time value used in the component. | Date | Yes | All | partially (only supports dynamic setting when mode=date and
display=spinner) | +| is24Hour | Allows changing of the time picker to a 24-hour format. | boolean | No | Windows and Android only | yes | +| maximumDate | Defines the maximum date that can be selected | Date | No | All | partially (only supported when mode=date and
display=spinner) | +| minimumDate | Defines the minimum date that can be selected. | Date | No | All | partially (only supported when mode=date and
display=spinner) | +| disabled | If true, the user won't be able to interact with the view. | boolean | No | IOS only | yes | +| textColor | Allows changing of the textColor of the date picker. | string | No | IOS only | partially (only supported when mode=date and
display=compact) | | timeZoneName | Allows changing of the time zone of the date picker. By default,
it uses the device's time zone.
Use the time zone name from the IANA (TZDB) database name in https://en.wikipedia.org/wiki/List_of_tz_database_time_zones. | string | No | iOS and Android only | No | | timeZoneOffsetInMinutes | Allows changing of the time zone of the date picker.
By default, it uses the device's time zone.
We strongly recommend using timeZoneName prop instead;
this prop has known issues in the android implementation (eg. #528). | number | No | iOS and Android only | No | | timeZoneOffsetInSeconds | Allows changing of the time zone of the date picker.
By default, it uses the device's time zone. | number | No | Windows only | No | @@ -319,6 +326,7 @@ Verified in the following versions. | testID | Usually used by app automation frameworks.
Fully supported on iOS.
On Android, only supported for mode="date". | string | No | All | Yes | | ViewProps | On iOS, you can pass any View props to the component.
Given that the underlying component is a native view,
not all of them are guaranteed to be supported,
but testID and onLayout are known to work. | Object | No | iOS only | No | | onError | Callback that is called when an error occurs inside
the date picker native code (such as null activity). | function | No | Android only | No | +| startOnYearSelection8.6.1+ | If true, the date picker will open with the year selector first. | boolean | No | Android only | partially (only supported when mode=date and display=compact) | ## Known Issues diff --git a/zh-cn/react-native-community-datetimepicker.md b/zh-cn/react-native-community-datetimepicker.md index 6be4304c..5c5e047a 100644 --- a/zh-cn/react-native-community-datetimepicker.md +++ b/zh-cn/react-native-community-datetimepicker.md @@ -23,6 +23,7 @@ | <= 7.6.2-0.1.1@deprecated | [@react-native-oh-tpl/datetimepicker Releases(deprecated)](https://github.com/react-native-oh-library/datetimepicker/releases) | 0.72 | | 7.6.3 | [@react-native-ohos/datetimepicker Releases](https://gitcode.com/openharmony-sig/rntpc_datetimepicker/releases) | 0.72 | | 8.4.3 | [@react-native-ohos/datetimepicker Releases](https://gitcode.com/openharmony-sig/rntpc_datetimepicker/releases) | 0.77 | +| 8.6.1 | [@react-native-ohos/datetimepicker Releases](https://gitcode.com/openharmony-sig/rntpc_datetimepicker/releases) | 0.82 | 对于未发布到npm的旧版本,请参考[安装指南](/zh-cn/tgz-usage.md)安装tgz包。 @@ -103,6 +104,7 @@ export const MDatetimepicker = () => { | | 是否支持autolink | RN框架版本 | |--------------------------------------|-----------------|------------| +| ~8.6.1 | No | 0.82 | | ~8.4.3 | No | 0.77 | | ~7.6.3 | Yes | 0.72 | | <= 7.6.2-0.1.1@deprecated | No | 0.72 | @@ -283,6 +285,7 @@ ohpm install 1. RNOH: 0.72.96; SDK: HarmonyOS 6.0.0 Release SDK; IDE: DevEco Studio 6.0.0.858; ROM: 6.0.0.112; 2. RNOH: 0.72.33; SDK: HarmonyOS NEXT B1; IDE: DevEco Studio: 5.0.3.900; ROM: Next.0.0.71; 3. RNOH: 0.77.18; SDK: HarmonyOS 6.0.0 Release SDK; IDE: DevEco Studio 6.0.0.858; ROM: 6.0.0.112; +4. RNOH: 0.82.1; SDK: HarmonyOS 6.0.1 Release SDK; IDE: DevEco Studio 6.0.1 Release; ROM:6.0.0.120 SP7 ## 属性 @@ -301,13 +304,13 @@ ohpm install | `design` | 定义选择器是否应使用 Material 3 组件或默认选择器。默认值为 "default"。 | string | 否 | Android only | No | | `initialInputMode` | 仅当 design 为 "material" 时生效。允许设置选择器的初始输入模式。 | string | 否 | Android only | No | | `title` | 仅当 design 为 "material" 时生效。允许设置选择器对话框的标题。 | string | 否 | Android only | No | -| `fullscreen` | 仅当 design 为 "material" 时生效。允许设置日期选择器对话框全屏显示。 | bool | 否 | Android only | No | +| `fullscreen` | 仅当 design 为 "material" 时生效。允许设置日期选择器对话框全屏显示。 | boolean | 否 | Android only | No | | `onChange` | 日期变更处理程序。 | function | 否 | All | partially (仅支持 type 为 set 类型) | | `value` | 定义组件中使用的日期或时间值。 | Date | 是 | All | partially (仅 mode=date 且
display=spinner 时支持动态设置) | -| `is24Hour` | 允许将时间选择器更改为 24 小时制格式。 | bool | 否 | Windows and Android only | yes | +| `is24Hour` | 允许将时间选择器更改为 24 小时制格式。 | boolean | 否 | Windows and Android only | yes | | `maximumDate` | 定义可选择的最大日期。 | Date | 否 | All | partially (仅支持在 mode=date 且
display=spinner 时设置) | | `minimumDate` | 定义可选择的最小日期。 | Date | 否 | All | partially (仅支持在 mode=date 且
display=spinner 时设置) | -| `disabled` | 如果为 true,用户将无法与该视图交互。 | bool | 否 | IOS only | yes | +| `disabled` | 如果为 true,用户将无法与该视图交互。 | boolean | 否 | IOS only | yes | | `textColor` | 允许更改日期选择器的文本颜色。 | string | 否 | IOS only | partially (仅支持在 mode=date 且
display=compact 时设置) | | `timeZoneName` | 允许更改日期选择器的时区。默认情况下,使用设备的时区。
使用来自 https://en.wikipedia.org/wiki/List_of_tz_database_time_zones 的 IANA (TZDB) 数据库名称中的时区名称。 | string | 否 | iOS and Android only | No | | `timeZoneOffsetInMinutes` | 允许更改日期选择器的时区。
默认情况下,使用设备的时区。
我们强烈建议改用 timeZoneName 属性;
此属性在 Android 实现中存在已知问题(例如 #528)。 | number | 否 | iOS and Android only | No | @@ -325,6 +328,7 @@ ohpm install | `testID` | 通常由应用自动化框架使用。
在 iOS 上完全支持。
在 Android 上,仅在 mode="date" 时支持。 | string | 否 | All | Yes | | `ViewProps` | 在 iOS 上,您可以将任何 View 属性传递给组件。
鉴于底层组件是原生视图,
不能保证支持所有属性,
但 testID 和 onLayout 是有效的。 | Object | 否 | iOS only | No | | `onError` | 当日期选择器原生代码内部发生错误(如 activity 为空)时调用的回调。 | function | 否 | Android only | No | +| `startOnYearSelection`8.6.1+ | 如果为 true,日期选择器将优先打开年份选择器。 | boolean | 否 | Android only | partially (仅支持在 mode=date 且display=compact 时设置) | ## 遗留问题 -- Gitee