moment.js concatenate date and time
The fail is trying on concatenate the values, test with something like this:
let initialdate = '2016-10-01';
let start_time = '19:04:10';
let enddate = '2016-10-01';
let end_time = '19:04:20';
let datetimeA = moment(initialdate + " " + start_time);
let datetimeB = moment(enddate + " " + end_time);
console.log(datetimeA.format());
console.log(datetimeB.format());
let datetimeC = datetimeB.diff(datetimeA, 'seconds');
console.log(datetimeC);
Concatenate the date and time strings and parse them as one, e.g.
var date = '23/02/2017';
var time = '15:42';
var dateTime = moment(date + ' ' + time, 'DD/MM/YYYY HH:mm');
console.log(dateTime.format('YYYY-MM-DD HH:mm'))
<script src="https://cdnjs.cloudflare.com/ajax/libs/moment.js/2.17.1/moment.js"></script>