Hello,
I need a public function in JavaScript that can be reused by other functions.
1- Where do I create this function? For example the following function:
function calculateHours(startTime, endTime) {
...
return hourDifference;
}
When I create a new function in Five, parameters five, context, result are added to the function. Can I simply get rid of these parameters and replace them by new parameters?
2- How can i call this public function? If I try:
function calculateHours(five, context, result) {
const start = five.field.StartIme;
const end = five.field.EndTime;
five.field.Hours = calculateHours(start, end);
return five.success(result);
}
I have the error “calculateHours is not defined”
Thank you!