Quantcast
Channel: Adobe Community : Popular Discussions - JavaScript
Viewing all articles
Browse latest Browse all 12130

Nested If statement confusion

$
0
0

so i have a clock in field and a clock out field and a third field that should show the number of minutes between the 2. However if the difference is 10 min or less then i want it to show the actual minutes but if it is 11 min or over just show "10". Here is what I have so far but i am confused on why it is not working and how to fix it. I am getting syntax error 17 at line 18

 

var strStart = this.getField("Break1O").value;
var strEnd = this.getField("Break1I").value;
strStart = strStart + " 1/1/70";
strEnd = strEnd + " 1/1/70";


if(strStart.length && strEnd.length)
{  var timeStart = util.scand("h:MM tt m/d/yy", strStart);  var timeEnd = util.scand("h:MM tt m/d/yy", strEnd);  var diff = timeEnd - timeStart;  var oneHour = 60 * 1000;  var timeleft = (diff/oneHour);  if (timeleft < 10);    {     event.value = timeleft;    }    else    {    event.value = 10    }
else  event.value = 0


;

Viewing all articles
Browse latest Browse all 12130

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>