diff --git a/harmony/datetimepicker.har b/harmony/datetimepicker.har new file mode 100644 index 00000000..3ffad823 Binary files /dev/null and b/harmony/datetimepicker.har differ diff --git a/harmony/datetimepicker/.gitignore b/harmony/datetimepicker/.gitignore new file mode 100644 index 00000000..e2713a27 --- /dev/null +++ b/harmony/datetimepicker/.gitignore @@ -0,0 +1,6 @@ +/node_modules +/oh_modules +/.preview +/build +/.cxx +/.test \ No newline at end of file diff --git a/harmony/datetimepicker/LICENSE b/harmony/datetimepicker/LICENSE new file mode 100644 index 00000000..c5c85db4 --- /dev/null +++ b/harmony/datetimepicker/LICENSE @@ -0,0 +1,21 @@ + MIT License + + Copyright (C) 2023 Huawei Device Co., Ltd. + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to deal + in the Software without restriction, including without limitation the rights + to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in all + copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + SOFTWARE. diff --git a/harmony/datetimepicker/OAT.xml b/harmony/datetimepicker/OAT.xml new file mode 100644 index 00000000..bf636592 --- /dev/null +++ b/harmony/datetimepicker/OAT.xml @@ -0,0 +1,38 @@ + + + + LICENSE + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/harmony/datetimepicker/README.OpenSource b/harmony/datetimepicker/README.OpenSource new file mode 100644 index 00000000..6a6dfa0b --- /dev/null +++ b/harmony/datetimepicker/README.OpenSource @@ -0,0 +1,11 @@ +[ + { + "Name": "datetimepicker", + "License": "MIT License", + "License File": "https://github.com/react-native-datetimepicker/datetimepicker/blob/master/LICENSE.md", + "Version Number": "7.6.2", + "Owner" : "Martijn Swaagman " + "Upstream URL": "https://github.com/react-native-datetimepicker/datetimepicker", + "Description": "datetimepicker, React Native date & time picker component." + } +] \ No newline at end of file diff --git a/harmony/datetimepicker/README.md b/harmony/datetimepicker/README.md new file mode 100644 index 00000000..a7db105d --- /dev/null +++ b/harmony/datetimepicker/README.md @@ -0,0 +1,262 @@ +> 模板版本:v0.0.1 + +

+

@react-native-community/datetimepicker

+

+

+ + Supported platforms + + + License + +

+ +## 安装与使用 + +进入到工程目录并输入以下命令: + + + +**正在 npm 发布中,当前请先从仓库[Release](https://github.com/react-native-oh-library/datetimepicker/releases)中获取库 tgz,通过使用本地依赖来安装本库。** + +#### **yarn** + +```bash +yarn add xxx +``` + +#### **npm** + +```bash +npm install xxx +``` + + + +下面的代码展示了这个库的基本使用场景: + +```js +import DateTimePicker from '@react-native-community/datetimepicker'; + +export const App = () => { + const [date, setDate] = useState(new Date(1598051730000)); + const [mode, setMode] = useState('date'); + const [show, setShow] = useState(false); + + const onChange = (event, selectedDate) => { + const currentDate = selectedDate; + setShow(false); + setDate(currentDate); + }; + + const showMode = (currentMode) => { + setShow(true); + setMode(currentMode); + }; + + const showDatepicker = () => { + showMode('date'); + }; + + const showTimepicker = () => { + showMode('time'); + }; + + return ( + +