diff --git a/src/recordings.jsx b/src/recordings.jsx index 1e93758..a203457 100644 --- a/src/recordings.jsx +++ b/src/recordings.jsx @@ -130,14 +130,13 @@ class Datetimepicker extends React.Component { } componentDidMount() { - let funcDate = this.handleDateChange; let datepicker = $(this.refs.datepicker).datetimepicker({ format: 'yyyy-mm-dd hh:ii:00', autoclose: true, todayBtn: true, }); - datepicker.on('changeDate', function(e) { - funcDate(e); + datepicker.on('changeDate', (e) => { + this.handleDateChange(e); }); $(this.refs.datepicker_input).datetimepicker('remove'); this.markDateField(); @@ -420,10 +419,10 @@ class Logs extends React.Component { this.earlier_than = this.props.recording.start; } this.getLogs(); - } - if (this.props.curTs) { - const ts = this.props.curTs; - this.loadForTs(ts); + if (this.props.curTs) { + const ts = this.props.curTs; + this.loadForTs(ts); + } } }