Refactoring

This commit is contained in:
Kyrylo Gliebov 2018-09-27 13:59:17 +02:00
parent 0a593d20d0
commit 2118f9e212

View file

@ -130,14 +130,13 @@ class Datetimepicker extends React.Component {
} }
componentDidMount() { componentDidMount() {
let funcDate = this.handleDateChange;
let datepicker = $(this.refs.datepicker).datetimepicker({ let datepicker = $(this.refs.datepicker).datetimepicker({
format: 'yyyy-mm-dd hh:ii:00', format: 'yyyy-mm-dd hh:ii:00',
autoclose: true, autoclose: true,
todayBtn: true, todayBtn: true,
}); });
datepicker.on('changeDate', function(e) { datepicker.on('changeDate', (e) => {
funcDate(e); this.handleDateChange(e);
}); });
$(this.refs.datepicker_input).datetimepicker('remove'); $(this.refs.datepicker_input).datetimepicker('remove');
this.markDateField(); this.markDateField();
@ -420,12 +419,12 @@ class Logs extends React.Component {
this.earlier_than = this.props.recording.start; this.earlier_than = this.props.recording.start;
} }
this.getLogs(); this.getLogs();
}
if (this.props.curTs) { if (this.props.curTs) {
const ts = this.props.curTs; const ts = this.props.curTs;
this.loadForTs(ts); this.loadForTs(ts);
} }
} }
}
render() { render() {
if (this.props.recording) { if (this.props.recording) {