Timesheet with AM and PM options
I have a very simple timesheet. 3 columns that consist of a TimeIn, TimeOut, and TotalTime. My question relates to how the time is entered. We want the user to be able to select the AM or PM of their In and Out (such as a drop down menu or something similar). This way depending on who is using it no typing other than a numberpad is needed for the time. Is this possible?
My Total Time javascript is:
event.value = '';
// get the start time
var sStart = this.getField('TimeIn.0').value;
// get the end time
var sEnd = this.getField('TimeOut.0').value;
// complete script only if we have data
if(sStart != '' & sEnd != '') {
// convert sStart string to seconds
var fStart = Time2Num('hh:mm', sStart);
// convert sEnd string to seconds
var fEnd = Time2Num('hh:mm', sEnd);
// compute difference in seconds
var fDiff = fEnd - fStart;
// convert to rounded minutes
fDiff = Math.round(fDiff / 60);
// report decimal hours
event.value = fDiff / 60;
}
