aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--HISTORY.md5
-rw-r--r--README.md48
-rw-r--r--package.json2
-rw-r--r--tests/Select.spec.jsx38
4 files changed, 68 insertions, 25 deletions
diff --git a/HISTORY.md b/HISTORY.md
index c6198f6..2436cb8 100644
--- a/HISTORY.md
+++ b/HISTORY.md
@@ -2,6 +2,11 @@
2 2
3--- 3---
4 4
52.3.0 / 2017-03-08
6---------------------------
7
8Add `use12Hours` prop.
9
52.2.0 / 2016-11-11 102.2.0 / 2016-11-11
6--------------------------- 11---------------------------
7 12
diff --git a/README.md b/README.md
index d8a35b9..fa1933a 100644
--- a/README.md
+++ b/README.md
@@ -48,30 +48,30 @@ API
48 48
49### TimePicker 49### TimePicker
50 50
51| Name | Type | Default | Description | 51| Name | Type | Default | Description |
52|-------------------------|-----------------------------------|-----------------------------------------------|--------------------------------------------------------------------------------------------| 52|-------------------------|-----------------------------------|---------|-------------|
53| prefixCls | String | | prefixCls of this component | 53| prefixCls | String | 'rc-time-picker' | prefixCls of this component |
54| clearText | String | 'clear' | | 54| clearText | String | 'clear' | clear tooltip of icon |
55| disabled | Boolean | false | whether picker is disabled | 55| disabled | Boolean | false | whether picker is disabled |
56| clearText | String | clear | clear text | 56| clearText | String | clear | clear text |
57| open | Boolean | false | current open state of picker. controlled prop | 57| open | Boolean | false | current open state of picker. controlled prop |
58| defaultValue | moment | null | default initial value | 58| defaultValue | moment | null | default initial value |
59| defaultOpenValue | moment | moment() | default open panel value, used to set utcOffset,locale if value/defaultValue absent | 59| defaultOpenValue | moment | moment() | default open panel value, used to set utcOffset,locale if value/defaultValue absent |
60| value | moment | null | current value | 60| value | moment | null | current value |
61| placeholder | String | '' | time input's placeholder | 61| placeholder | String | '' | time input's placeholder |
62| showHour | Boolean | whether show hour | | 62| showHour | Boolean | true | whether show hour | |
63| showMinute | Boolean | whether show minute | | 63| showMinute | Boolean | true | whether show minute |
64| showSecond | Boolean | whether show second | | 64| showSecond | Boolean | true | whether show second |
65| format | String | | | 65| format | String | - | moment format |
66| disabledHours | Function | disabled hour options | | 66| disabledHours | Function | - | disabled hour options |
67| disabledMinutes | Function | disabled minute options | | 67| disabledMinutes | Function | - | disabled minute options |
68| disabledSeconds | Function | disabled second options | | 68| disabledSeconds | Function | - | disabled second options |
69| use12Hours | Boolean | 12 hours display mode | | 69| use12Hours | Boolean | false | 12 hours display mode |
70| hideDisabledOptions | Boolean | whether hide disabled options | | 70| hideDisabledOptions | Boolean | false | whether hide disabled options |
71| onChange | Function | null | called when select a different value | 71| onChange | Function | null | called when select a different value |
72| addon | Function | nothing | called from timepicker panel to render some addon to its bottom, like an OK button. Receives panel instance as parameter, to be able to close it like `panel.close()`.| 72| addon | Function | - | called from timepicker panel to render some addon to its bottom, like an OK button. Receives panel instance as parameter, to be able to close it like `panel.close()`.|
73| placement | String | bottomLeft | one of ['left','right','top','bottom', 'topLeft', 'topRight', 'bottomLeft', 'bottomRight'] | 73| placement | String | bottomLeft | one of ['left','right','top','bottom', 'topLeft', 'topRight', 'bottomLeft', 'bottomRight'] |
74| transitionName | String | '' | | 74| transitionName | String | '' | |
75| name | String | - | sets the name of the generated input | 75| name | String | - | sets the name of the generated input |
76| onOpen | Function({ open }) | | when TimePicker panel is opened | 76| onOpen | Function({ open }) | | when TimePicker panel is opened |
77| onClose | Function({ open }) | | when TimePicker panel is opened | 77| onClose | Function({ open }) | | when TimePicker panel is opened |
diff --git a/package.json b/package.json
index d4c89a1..962f800 100644
--- a/package.json
+++ b/package.json
@@ -1,6 +1,6 @@
1{ 1{
2 "name": "rc-time-picker", 2 "name": "rc-time-picker",
3 "version": "2.2.2", 3 "version": "2.3.0",
4 "description": "React TimePicker", 4 "description": "React TimePicker",
5 "keywords": [ 5 "keywords": [
6 "react", 6 "react",
diff --git a/tests/Select.spec.jsx b/tests/Select.spec.jsx
index ea0a827..fd2ec32 100644
--- a/tests/Select.spec.jsx
+++ b/tests/Select.spec.jsx
@@ -452,5 +452,43 @@ describe('Select', () => {
452 done(); 452 done();
453 }); 453 });
454 }); 454 });
455
456 it('renders uppercase AM correctly', (done) => {
457 const picker = renderPicker({
458 use12Hours: true,
459 defaultValue: moment().hour(0).minute(0).second(0),
460 showSecond: false,
461 format: 'h:mm A',
462 });
463 expect(picker.state.open).not.to.be.ok();
464 const input = TestUtils.scryRenderedDOMComponentsWithClass(picker,
465 'rc-time-picker-input')[0];
466 let selector;
467 async.series([(next) => {
468 expect(picker.state.open).to.be(false);
469
470 Simulate.click(input);
471 setTimeout(next, 100);
472 }, (next) => {
473 expect(picker.state.open).to.be(true);
474 selector = TestUtils.scryRenderedDOMComponentsWithClass(picker.panelInstance,
475 'rc-time-picker-panel-select')[2];
476 expect((input).value).to.be('12:00 AM');
477 const option = selector.getElementsByTagName('li')[1];
478 Simulate.click(option);
479 setTimeout(next, 200);
480 }, (next) => {
481 expect((input).value).to.be('12:00 PM');
482 next();
483 }, (next) => {
484 Simulate.click(selector.getElementsByTagName('li')[0]);
485 setTimeout(next, 200);
486 }, (next) => {
487 expect((input).value).to.be('12:00 AM');
488 next();
489 }], () => {
490 done();
491 });
492 });
455 }); 493 });
456}); 494});