Hello team,
From last day I am facing problem of date addition in the form application. On start date blur event, I want to add duration such that end date should obtain and here is my code.
StartDate_onBlur:
if({StartDate} != null)
{
// sc_date(date, format, operator, D,M,Y)
// $date=sc_date({StartDate}, "ddmmyyyy", "+", {Duration}, 0, 0);
// {EndDate}=$date;
// {EndDate} = sc_date({StartDate}, "dd-mm-yyyy", "+", 30, 0, 0);
// sc_error_message({EndDate});
$dt = {StartDate};
$cd = strtotime($dt);
$newDate = date("d-m-Y", mktime(0,0,0,date("m", $cd),date("d", $cd),date("Y", $cd)));
{EndDate} = $newDate;
}
I am getting some output but it is not correct such as 03-08-2013 + 129 = 69-19-3112. Where do it going wrong?
–
Milind