How can I translate this pseudo code into working js [don\'t worry about where the end date comes from except that it\'s a valid javascript date].
var myEndD
You can also use get and set minutes to achieve it:
var endDate = somedate; var startdate = new Date(endDate); var durationInMinutes = 20; startdate.setMinutes(endDate.getMinutes() - durationInMinutes);