function errors in zoho flow
I think the resolution to this issue is probably very simple, but I cannot find it anywhere…
I’ve prepared the function below to run in Zoho Flow. The goal is to create calendar appointments for team’s time off. Google date format ends multi-day events 1 day early, so hoping to extend the end date to cover the true duration of the time off request.
I am receiving this error message everytime I try to save; “Missing return statement: Provide STRING expression to return at line number 3. Resolve the errors and try again”
Anyone able to help point out my errors? TIA!
Here’s my code;
string modifyEndDate1(date startDate, date endDate)
{
NewStartDate = startDate.toString("yyyy-MM-dd'T'HH:mm:ss-05:00");
NewEndDate = endDate.toString("yyyy-MM-dd'T'HH:mm:ss-05:00");
if(NewStartDate.daysBetween(NewEndDate) > 1)
{
FinalEndDate = NewEndDate.addHour(23).addMinutes(59).addSeconds(59);
UpdatedEndDate = FinalEndDate.toString("yyyy-MM-dd'T'HH:mm:ss-05:00");
return UpdatedEndDate;
}
else if(NewStartDate.daysBetween(NewEndDate) == 0)
{
FinalEndDate = NewEndDate;
UpdatedEndDate = FinalEndDate.toString("yyyy-MM-dd'T'HH:mm:ss-05:00");
return UpdatedEndDate;
}
}