this.returnDateTime = ko.computed(function() { var selectedHr,selectedMin,jd,day,hr,min; if (self.startTime().split(" ")[1] === "AM") { if (self.startTime() === '12:00 AM'||self.startTime() === '12:30 AM') { selectedHr = 0; } else { selectedHr = parseInt(self.startTime().split(" ")[0].split(":")[0]); } } else { if (self.startTime() === '12:00 PM'||self.startTime() === '12:30 PM') { selectedHr = 12; } else { selectedHr = parseInt(self.startTime().split(" ")[0].split(":")[0]) + 12; } } selectedMin= parseInt(self.startTime().split(" ")[0].split(":")[1]); jd=self.Duration().split(" ");//it will be variable based on distance(format is: 2 day 2hr 33min (or) 5hr 45min) if(jd[1]==="day(s)") { day=jd[0];hr=jd[2];min=jd[4]; }else if(jd[1]==="hr(s)"){hr=jd[0];min=jd[2]} var startDate=moment($('#startDate').val()).format("DD/MM/YYYY");// if it is 25/01/2016 /// how to add duration days hrs mins to the selected startDateand startTime and get the new date and time }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)