How can I properly combine the variable secondsToMinutes
with the startdate
?
The value of secondsToMinutes
is "3:20"
and the startDate
is "2:00 PM".
The desired endDate
should be "2:03:20 PM".
Despite my efforts, I keep encountering errors every time I attempt to achieve this.
var startdate = data.StartTime;
startdate = moment(startdate).format('LTS');
var secondsToMinutes = readableDuration(self.runlength());//='3:20';
var seconds = secondsToMinutes.split(':')[1];
var minutes = secondsToMinutes.split(':')[0];
var date = moment(startdate)
.add(seconds, 'seconds')
.add(minutes, 'minutes')
.format('LTS');
However, the date appears as an invalid date.