# @beisen-phoenix/date-time-picker

> 输入或选择日期和时间的控件。

Latest version **3.3.55** (published 2019-11-25) · ISC license · 0 weekly downloads

## Install

```sh
npm install @beisen-phoenix/date-time-picker
pnpm add @beisen-phoenix/date-time-picker
yarn add @beisen-phoenix/date-time-picker
bun add @beisen-phoenix/date-time-picker
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 3.3.55 |
| Published | 2019-11-25 |
| First published | 2019-04-17 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 7 |
| Unpacked size | 80.8 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Maintainers | beisencorp |

## Links

- npm: https://www.npmjs.com/package/@beisen-phoenix/date-time-picker
- npm.io page: https://npm.io/package/@beisen-phoenix/date-time-picker

## Dependencies (7)

- [moment](https://npm.io/package/moment.md) ^2.24.0
- [@beisen-phoenix/input](https://npm.io/package/@beisen-phoenix/input.md) ^3.3.55
- [@beisen-phoenix/button](https://npm.io/package/@beisen-phoenix/button.md) ^3.3.55
- [@beisen-phoenix/date-picker](https://npm.io/package/@beisen-phoenix/date-picker.md) ^3.3.55
- [@beisen-phoenix/rc-calendar](https://npm.io/package/@beisen-phoenix/rc-calendar.md) ^3.3.55
- [@beisen-phoenix/time-picker](https://npm.io/package/@beisen-phoenix/time-picker.md) ^3.3.55
- [@beisen-phoenix/unmodeled-layer](https://npm.io/package/@beisen-phoenix/unmodeled-layer.md) ^3.3.55

## Recent versions

- 3.3.55 (latest) — 2019-11-25
- 3.2.44-rc.1 (rc) — 2019-10-24
- 3.3.54 — 2019-11-25
- 3.3.53 — 2019-11-25
- 3.3.52 — 2019-11-24
- 3.3.51 — 2019-11-23
- 3.3.50 — 2019-11-22
- 3.3.49 — 2019-11-22
- 3.3.48 — 2019-11-22
- 3.3.46 — 2019-11-22
- 3.3.45 — 2019-11-21
- 3.3.43 — 2019-11-21
- 3.3.42 — 2019-11-21
- 3.3.41-beta.1 — 2019-11-21
- 3.3.41 — 2019-11-21
- … 435 more at https://npm.io/package/@beisen-phoenix/date-time-picker/versions

## README

输入或选择日期和时间的控件。

## 约定
所有value为moment格式或string，如使用moment格式请确保引入了moment来进行格式转化。

## 国际化配置

内置了多语言相关处理，只需要传递lang参数即可。  
**注意：**部分 locale 是从 value 中读取，所以请先正确设置 moment 的 locale。

```jsx
import moment from 'moment';
import 'moment/locale/zh-cn';
moment.locale('zh-cn');

<DateTimePicker defaultValue={moment('2019-04-01', 'YYYY-MM-DD')} />
```

## DateTimePicker API

| 参数 | 说明 | 类型 | 默认值 | 版本 |
| --- | --- | --- | --- | --- |
| lang | 面板语言 | `zhCN/zhTW/enUS` | 'zhCN' |
| datePickerProps | 日期组件的相关属性，具体请参考[date-picker](http://cmp.italent-inc.cn/details?id=1161) | object | 无 |
| timePickerProps | 时间组件的相关属性，具体请参考[time-picker](http://cmp.italent-inc.cn/details?id=1162) | object | 无 |
| value | 选中的日期时间值 | `string` 或 moment | 无 |
| onChange | 日期时间发生变化的回调 | function(dateTime: moment,): void | 无 |
| onClear | 日期时间均被清空时的回调 | function(): void | 无 |
| disabledTime| 禁止选择部分小时/分钟/秒的选项 | () => {disabledHours: Function,disabledMinutes: Function,disabledSeconds: Function} | |
| onOk | 点击确定按钮的回调函数 | function(string) |  |

## DateTimeRangePicker API

| 参数 | 说明 | 类型 | 默认值 | 版本 |
| --- | --- | --- | --- | --- |
| lang | 面板语言 | `zhCN/zhTW/enUS` | 'zhCN' |
| datePickerProps | 日期组件的相关属性，具体请参考[date-picker](http://cmp.italent-inc.cn/details?id=1161) | object | 无 |
| timePickerProps | 时间组件的相关属性，具体请参考[time-picker](http://cmp.italent-inc.cn/details?id=1162) | object | 无 |
| value | 选中的日期时间值 |[string,string] 或 [moment, moment] | 无 |
| onChange | 日期时间发生变化的回调 | function(dateTime: moment,): void | 无 |
| onClear | 日期时间均被清空时的回调 | function(): void | 无 |

## 一点碎碎念

DateRangePicker中原始代码屏蔽了showClear导致无法显示清除按钮，已经修复过了，但是点击之后由于只有一个清除事件，所以点击时是清空全部内容而不是清理单个输入框，请留意。


#### changelist

2019-08-14
value 新增string格式

---
_Source: https://npm.io/package/@beisen-phoenix/date-time-picker · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
