-
{
+
+ renderInput = ref => {
+ const { isOpen, inputValue, isGregorian } = this.state;
+
+ const className = classnames(this.props.className, {
+ [outsideClickIgnoreClass]: isOpen
+ });
+
+ return (
+
+ {
this.input = inst;
}}
- onFocus={this.handleFocus.bind(this)}
- onBlur={this.hanldeBlur.bind(this)}
- onChange={this.handleInputChange.bind(this)}
- onClick={this.handleInputClick.bind(this)}
- value={
+ onFocus={this.handleFocus.bind(this)}
+ onBlur={this.hanldeBlur.bind(this)}
+ onChange={this.handleInputChange.bind(this)}
+ onClick={this.handleInputClick.bind(this)}
+ value={
isGregorian || !this.props.persianDigits ? inputValue : this.toPersianDigits(inputValue)
}
- readOnly={this.props.inputReadOnly === true}
- disabled={this.props.disabled}
- />
-
- );
- };
-
- renderCalendar = ref => {
- const { momentValue, isGregorian, timePickerComponent: TimePicker } = this.state;
- const {
- onChange,
- min,
- max,
- defaultYear,
- defaultMonth,
- styles,
- calendarContainerProps,
- ranges,
- disableYearSelector,
- } = this.props;
-
- return (
-
-
+
+ );
+ };
+
+ renderCalendar = ref => {
+ const { momentValue, isGregorian, timePickerComponent: TimePicker } = this.state;
+ const {
+ onChange,
+ min,
+ max,
+ defaultYear,
+ defaultMonth,
+ styles,
+ calendarContainerProps,
+ ranges,
+ disableYearSelector,
+ time_picker_props
+ } = this.props;
+
+ let timePickerProps = {};
+
+ if (time_picker_props != undefined && (typeof time_picker_props == typeof {})) {
+ timePickerProps = time_picker_props;
+ }
+ timePickerProps = Object.assign(timePickerProps, {
+ outsideClickIgnoreClass: outsideClickIgnoreClass,
+ isGregorian: isGregorian,
+ min: min,
+ max: max,
+ momentValue: momentValue,
+ setMomentValue: this.setMomentValue.bind(this),
+ });
+
+ return (
+
+
+
) : null
}
- />
-
- );
- };
-
- removeDate() {
- const { onChange } = this.props;
- if (onChange) {
- onChange(null);
+ />
+
+ );
+ };
+
+ removeDate() {
+ const { onChange } = this.props;
+ if (onChange) {
+ onChange(null);
+ }
+ this.setState({
+ input: '',
+ inputValue: '',
+ momentValue: null
+ });
}
- this.setState({
- input: '',
- inputValue: '',
- momentValue: null
- });
- }
-
- render() {
- const { isOpen } = this.state;
-
- return (
-