]> git.immae.eu Git - github/fretlink/time-picker.git/commitdiff
show12Hours prop was renamed to use12Hours
authorAntony Shaleynikov <shaleynikov@gmail.com>
Thu, 2 Mar 2017 08:02:45 +0000 (11:02 +0300)
committerAntony Shaleynikov <shaleynikov@gmail.com>
Thu, 2 Mar 2017 08:02:45 +0000 (11:02 +0300)
README.md
src/Combobox.jsx
src/Panel.jsx
src/TimePicker.jsx

index b9d06fda604552a47a619592da0bce85a3c2eba4..d8a35b9c3a004440b4dbbe3c9192e51efad6e67b 100644 (file)
--- a/README.md
+++ b/README.md
@@ -60,13 +60,13 @@ API
 | value                   | moment                            | null                                          | current value                                                                              |
 | placeholder             | String                            | ''                                            | time input's placeholder                                                                   |
 | showHour                | Boolean                           | whether show hour                             |                                                                                            |
-| showMinute                | Boolean                         | whether show minute                             |                                                                                            |
+| showMinute              | Boolean                           | whether show minute                             |                                                                                            |
 | showSecond              | Boolean                           | whether show second                           |                                                                                            |
 | format                  | String                            |                                               |                                                                                            |
 | disabledHours           | Function                          | disabled hour options                         |                                                                                            |
 | disabledMinutes         | Function                          | disabled minute options                       |                                                                                            |
 | disabledSeconds         | Function                          | disabled second options                       |                                                                                            |
-| show12Hours             | Boolean                           | 12 hours display mode                         |                                                                                            |
+| use12Hours              | Boolean                           | 12 hours display mode                         |                                                                                            |
 | hideDisabledOptions     | Boolean                           | whether hide disabled options                 |                                                                                            |
 | onChange                | Function                          | null                                          | called when select a different value                                                       |
 | 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()`.|
index e31b7fdac95201008653478b831d1725dc7127a1..339764cba1e7530927937e6c8945f1ac3d5c3d7d 100644 (file)
@@ -35,15 +35,15 @@ const Combobox = React.createClass({
     disabledMinutes: PropTypes.func,
     disabledSeconds: PropTypes.func,
     onCurrentSelectPanelChange: PropTypes.func,
-    show12Hours: PropTypes.bool,
+    use12Hours: PropTypes.bool,
   },
 
   onItemChange(type, itemValue) {
-    const { onChange, defaultOpenValue, show12Hours } = this.props;
+    const { onChange, defaultOpenValue, use12Hours } = this.props;
     const value = (this.props.value || defaultOpenValue).clone();
 
     if (type === 'hour') {
-      if (show12Hours) {
+      if (use12Hours) {
         if (value.hour() > 12 || !value.hour()) {
           value.hour(+itemValue + 12);
         } else {
@@ -55,7 +55,7 @@ const Combobox = React.createClass({
     } else if (type === 'minute') {
       value.minute(+itemValue);
     } else if (type === 'ampm') {
-      if (show12Hours) {
+      if (use12Hours) {
         if (itemValue === 'PM' && value.hour() <= 12) {
           value.hour(value.hour() + 12);
         }
@@ -80,13 +80,13 @@ const Combobox = React.createClass({
   },
 
   getHourSelect(hour) {
-    const { prefixCls, hourOptions, disabledHours, showHour, show12Hours } = this.props;
+    const { prefixCls, hourOptions, disabledHours, showHour, use12Hours } = this.props;
     if (!showHour) {
       return null;
     }
     const disabledOptions = disabledHours();
     let hourAdj;
-    if (show12Hours) {
+    if (use12Hours) {
       if (hour > 12) {
         hourAdj = hour - 12;
       } else {
@@ -97,7 +97,7 @@ const Combobox = React.createClass({
     }
 
     let hourOptionsAdj;
-    if (show12Hours) {
+    if (use12Hours) {
       hourOptionsAdj = hourOptions.filter(h => h <= 12 && h > 0);
     } else {
       hourOptionsAdj = hourOptions;
@@ -156,8 +156,8 @@ const Combobox = React.createClass({
   },
 
   getAMPMSelect() {
-    const { prefixCls, show12Hours, defaultOpenValue } = this.props;
-    if (!show12Hours) {
+    const { prefixCls, use12Hours, defaultOpenValue } = this.props;
+    if (!use12Hours) {
       return null;
     }
     const value = this.props.value || defaultOpenValue;
index d02bd01c461ae9cdbf796520f70b84abb461c375..df128ff67d75741216952588899a005c570bb30f 100644 (file)
@@ -37,7 +37,7 @@ const Panel = React.createClass({
     showMinute: PropTypes.bool,
     showSecond: PropTypes.bool,
     onClear: PropTypes.func,
-    show12Hours: PropTypes.bool,
+    use12Hours: PropTypes.bool,
     addon: PropTypes.func,
   },
 
@@ -50,7 +50,7 @@ const Panel = React.createClass({
       disabledMinutes: noop,
       disabledSeconds: noop,
       defaultOpenValue: moment(),
-      show12Hours: false,
+      use12Hours: false,
       addon: noop,
     };
   },
@@ -92,7 +92,7 @@ const Panel = React.createClass({
     const {
       prefixCls, className, placeholder, disabledHours, disabledMinutes,
       disabledSeconds, hideDisabledOptions, allowEmpty, showHour, showMinute, showSecond,
-      format, defaultOpenValue, clearText, onEsc, addon, show12Hours,
+      format, defaultOpenValue, clearText, onEsc, addon, use12Hours,
     } = this.props;
     const {
       value, currentSelectPanel,
@@ -142,7 +142,7 @@ const Panel = React.createClass({
           disabledMinutes={disabledMinutes}
           disabledSeconds={disabledSeconds}
           onCurrentSelectPanelChange={this.onCurrentSelectPanelChange}
-          show12Hours={show12Hours}
+          use12Hours={use12Hours}
         />
         {addon(this)}
       </div>
index f73d2b14cb60777b87b93aa4b2e8f93df38ca8e1..6b762230223844c7a1f28ca0ebe2aebdb4b45f5a 100644 (file)
@@ -43,7 +43,7 @@ const Picker = React.createClass({
     addon: PropTypes.func,
     name: PropTypes.string,
     autoComplete: PropTypes.string,
-    show12Hours: PropTypes.bool,
+    use12Hours: PropTypes.bool,
   },
 
   getDefaultProps() {
@@ -68,7 +68,7 @@ const Picker = React.createClass({
       onOpen: noop,
       onClose: noop,
       addon: noop,
-      show12Hours: false,
+      use12Hours: false,
     };
   },
 
@@ -144,7 +144,7 @@ const Picker = React.createClass({
       prefixCls, placeholder, disabledHours,
       disabledMinutes, disabledSeconds, hideDisabledOptions,
       allowEmpty, showHour, showMinute, showSecond, defaultOpenValue, clearText,
-      addon, show12Hours,
+      addon, use12Hours,
     } = this.props;
     return (
       <Panel
@@ -166,7 +166,7 @@ const Picker = React.createClass({
         disabledMinutes={disabledMinutes}
         disabledSeconds={disabledSeconds}
         hideDisabledOptions={hideDisabledOptions}
-        show12Hours={show12Hours}
+        use12Hours={use12Hours}
         addon={addon}
       />
     );