Jump to content
  • 0

Start and End times fields


roattw

Question

Having trouble finding an easy way to have people select a start time and end time so the difference can later be calculated.  This would be on same date.

I can insert two date field using date and time but the user has to enter the date calendar pop up twice and then change the two times.  Seems clunky.

Im usually missing something easy...

Link to comment
Share on other sites

1 answer to this question

Recommended Posts

  • 0

Hello @roattw

You can set the Date value once and copy the value into second hidden field using JS.
Here is the example based on two Virtual fields:

<script>
function copyDate(event) {
 let targetInput = document.getElementById('cbParamVirtual2');
 targetInput.value = event.target.value;
}

function copyDateHandler() {
 document.getElementById('cbParamVirtual1').addEventListener('change', copyDate);
 document.removeEventListener('DataPageReady', copyDateHandler);
}

document.addEventListener('DataPageReady', copyDateHandler);
</script>

 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...