j0sh
02-27-2003, 06:45 PM
i have a dropdown of selects wher ethe options are
..
..
..
"07:50"
"08:00"
"08:10"
..
..
..
etc
now i have a function that grabs the info from that and converts it into number of minutes..
for all the numbers it works fine parseInt the value.. after spliting it by : into hours and minutes
but with any number that is 08 or 09 it parseInts to 0 instead of 8 or 9
any thoughts here's my function
function checktimes() {
v_early = String(document.addform.minTime[document.addform.minTime.selectedIndex].value);
early_array = v_early.split(":");
early_mins = parseInt(early_array[0]) * 60;
early_mins += parseInt(early_array[1]);
alert(early_mins);
}
just converts the hours/minutes to total minutes
any help is appreciated thanks
..
..
..
"07:50"
"08:00"
"08:10"
..
..
..
etc
now i have a function that grabs the info from that and converts it into number of minutes..
for all the numbers it works fine parseInt the value.. after spliting it by : into hours and minutes
but with any number that is 08 or 09 it parseInts to 0 instead of 8 or 9
any thoughts here's my function
function checktimes() {
v_early = String(document.addform.minTime[document.addform.minTime.selectedIndex].value);
early_array = v_early.split(":");
early_mins = parseInt(early_array[0]) * 60;
early_mins += parseInt(early_array[1]);
alert(early_mins);
}
just converts the hours/minutes to total minutes
any help is appreciated thanks