Calculate End Time

⏱ Determine end times with our Interaction.

1. Overview

This Interaction outlines the functionality for calculating the End Time based on changes in the Duration (in minutes).

2. Example

This example shows how to calculate the End Time based on the given configuration.

This code fetches the start-time and duration, then calculates the end-time by adding the duration to the start time. The final step is updating the end-time field with the calculated value.

async function handler(clev) {
    let actions = [];

    let startTime = clev.getValue("start-time");
    let duration = clev.getValue("duration");

    actions.push(
        clev.setValue(
            "end-time",
            clev.moment(startTime).add(duration, "minutes").toISOString()
        )
    );

    return clev.mergeAll(actions);
}

📌 Need Help?

If you require assistance or encounter any issues, please don't hesitate to contact us for further support.