calculate new date

Hello
I used asp.net make 2021 , and like to add number of days for initial date and extract the new date automatically.
there is any easy way to do that please?
will appreciate for any help.
Thanks

It should be something like:
Convert.ToDateTime().AddDays().ToString()

actually its not working , even if I try the current date and put in new field not working too.

If you have any clear sample to da that please??

Show your actual codes.

something like this :
var days = $row[“Period”].toNumber();
Convert.ToDateTime(‘Project_Start_Date’).AddDays(days).ToString()
$row[“Project_End_Date”].value(Project_Start_Date);Period is the numbers of days which want to add
Project_Start_Date is first date
Project_End_Date is final date after add days

You can forget this code , any simple code with that information (started date , period days and end date (wanted))?
Thanks

If you are referring to client side script (JavaScript), it should be something like:var days = $row[“Period”].toNumber();
var dt = ew.formatDateTime($row[“Project_Start_Date”].toDate().plus({ days: days }), ew.DATE_FORMAT);
$row[“Project_End_Date”].value(dt);

yes I am you are referring to client side script , but still not working.
this code not work fine :
var dt = ew.formatDateTime($row[“Project_Start_Date”].toDate().plus({ days: days }), ew.DATE_FORMAT);
i did try the others and were so good.

Press F12 → Console to check if there is any JavaScript error. Add codes to show and debug the values. For example:var days = …;
console.log(“days:” + days);
console.log(“start date:” + $row[“Project_Start_Date”]);
// etc…

I did check that , and found this :
(ew.formatDateTime) is not a function.

Sorry, the codes are for ASP.NET Maker 2022. For older version, try ew.formatDate

That’s right , about the part (ew.formatDateTime) and no problem if I change this to (ew.formatDate)
but still another parts not a function : ($row[“Project_Start_Date”].toDate().plus({ days: days }), ew.DATE_FORMAT);Thanks

Old version use moment. It should be something like:var days = $row[“Period”].toNumber();
var startDate = $row[“Project_Start_Date”].val();
// console.log(startDate);
var endDate = ew.parseDate(startDate, ew.DATE_FORMAT.toUpperCase()).add({ days: 7 });
// console.log(endDate, ew.formatDate(endDate));
$row[“Project_End_Date”].value(ew.formatDate(endDate));

Thank You so much , its work fine now