Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/reactjs/24.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Css 如何减少dateTimePicker的宽度和高度?_Css_Reactjs_Redux Form_React Bootstrap - Fatal编程技术网

Css 如何减少dateTimePicker的宽度和高度?

Css 如何减少dateTimePicker的宽度和高度?,css,reactjs,redux-form,react-bootstrap,Css,Reactjs,Redux Form,React Bootstrap,我想减少datetime选择器框的宽度和高度。这是我的dateTimePicker中的图像 这是我的组成部分: import React,{useState} from 'react'; import momentLocaliser from 'react-widgets-moment'; import DateTime from 'react-datetime'; import PropTypes from 'prop-types'; import classNames from 'class

我想减少datetime选择器框的宽度和高度。这是我的dateTimePicker中的图像

这是我的组成部分:

import React,{useState} from 'react';
import momentLocaliser from 'react-widgets-moment';
import DateTime from 'react-datetime';
import PropTypes from 'prop-types';
import classNames from 'classnames';
import 'react-datetime/css/react-datetime.css';

const moment = require('moment');

     moment.locale('es');
     momentLocaliser(moment);

     const DateTimePickerInput = ({
         label,
         format,
         input,
         width,
         placeholder,
         selected,
         tooltip,
         tooltipPlacement,
         disabled,
         defaultValue,
         value,
         onChange,
         inputProps,
         meta: { valid, touched, error},
         showTime,
         style,
         ...props
     }) => {
         const classes = classNames('form-group', {
         'has-error': (touched && !valid),
         'has-success': (touched && !valid)
     })
     return (
         <div className={classes}>
             <label htmlFor={input.name}>{label}</label> <br />
             <DateTime
                 name = {input.name}
                 locale='es'
                 dateFormat= "DD-MM-YYYY"
                 timeFormat= "HH:mm:ss"
                 onChange={param => {
                     input.onChange(param)
                 }}
                inputProps={{placeholder: !input.value ? 'Please, select a date':                    moment(input.value).format('DD-MM-YYYY HH:mm:ss')/*,disabled: true}*/}}
                style={{}}

                 {(!valid && touched) &&
                     <p className='help-block'>{error}</p>
                 }
          </div>
       );
          };

       DateTimePickerInput.propTypes = {
           disabled: PropTypes.bool,
           input: PropTypes.object.isRequired,
           label: PropTypes.string.isRequired,
           meta: PropTypes.object.isRequired,
           placeholder: PropTypes.string,
           tooltip: PropTypes.string,
           tooltipPlacement: PropTypes.string
                                                            }

export default DateTimePickerInput;

我使用react datetime作为依赖项。小部件的框太宽了,我需要减小框的宽度。如何减小日期时间选择器框的宽度?

覆盖
react datetime
的CSS规则,如下所示:

.rdtPicker {
  width: 400px; //Change it your preferred width
}

.rdtPicker tr {
  height: 50px; //Choose the height of each row so that the overall height will change
}
这是一张工作票

.rdtPicker {
  width: 400px; //Change it your preferred width
}

.rdtPicker tr {
  height: 50px; //Choose the height of each row so that the overall height will change
}