mirror of
https://github.com/shlinkio/shlink-web-client.git
synced 2024-12-26 02:48:22 +03:00
32 lines
863 B
JavaScript
32 lines
863 B
JavaScript
|
import calendarIcon from '@fortawesome/fontawesome-free-regular/faCalendarAlt';
|
||
|
import FontAwesomeIcon from '@fortawesome/react-fontawesome';
|
||
|
import React from 'react';
|
||
|
import DatePicker from 'react-datepicker';
|
||
|
import './DateContainer.scss';
|
||
|
|
||
|
export default class DateInput extends React.Component {
|
||
|
constructor(props) {
|
||
|
super(props);
|
||
|
this.inputRef = React.createRef();
|
||
|
}
|
||
|
|
||
|
render() {
|
||
|
return (
|
||
|
<div className="date-input-container">
|
||
|
<DatePicker
|
||
|
{...this.props}
|
||
|
className="date-input-container__input form-control"
|
||
|
dateFormat="YYYY-MM-DD"
|
||
|
readOnly
|
||
|
ref={this.inputRef}
|
||
|
/>
|
||
|
<FontAwesomeIcon
|
||
|
icon={calendarIcon}
|
||
|
className="date-input-container__icon"
|
||
|
onClick={() => this.inputRef.current.input.focus()}
|
||
|
/>
|
||
|
</div>
|
||
|
);
|
||
|
}
|
||
|
}
|