Team:Warsaw/Calendar-Main/EmptyDays

From 2008.igem.org

(Difference between revisions)
Line 2: Line 2:
<html>
<html>
<h1>Empty entries locator</h1>
<h1>Empty entries locator</h1>
 +
<form name="params" action="JavaScript:find_empty()">
 +
<table class="month" width="100%">
 +
 +
<tr><td width="50%">Start date</td><td>End date</td></tr>
 +
<tr><td width="50%">
 +
<input type="text" value="1" size=1 name="start_day">
 +
<select name="start_month">
 +
<option value="January">January</option>
 +
<option value="February">February</option>
 +
<option value="March">March</option>
 +
<option value="April">April</option>
 +
<option value="May" selected="selected">May</option>
 +
<option value="June">June</option>
 +
<option value="July">July</option>
 +
<option value="August">August</option>
 +
<option value="September">September</option>
 +
<option value="October">October</option>
 +
<option value="November">November</option>
 +
<option value="December">December</option>
 +
</select>
 +
<input type="text" value="2008" size=3 name="start_year" disabled="disabled">
 +
</td>
 +
<td>
 +
<input type="text" value="1" size=1 name="end_day">
 +
<select name="end_month">
 +
<option value="January">January</option>
 +
<option value="February">February</option>
 +
<option value="March">March</option>
 +
<option value="April">April</option>
 +
<option value="May">May</option>
 +
<option value="June" selected="selected">June</option>
 +
<option value="July">July</option>
 +
<option value="August">August</option>
 +
<option value="September">September</option>
 +
<option value="October">October</option>
 +
<option value="November">November</option>
 +
<option value="December">December</option>
 +
</select>
 +
<input type="text" value="2008" size=3 name="end_year" disabled="disabled">
 +
</td></tr></table>
 +
<input type="submit" value="Go!">
 +
</form>
 +
<h4 id="progress"></h4>
<h4 id="progress"></h4>
<ul id="results"></ul>
<ul id="results"></ul>
Line 106: Line 149:
}
}
-
next_empty("1_May_2008","5_May_2008");
+
function find_empty()
 +
{
 +
var start_day=parseInt(document.params.start_day.value);
 +
var start_month=document.params.start_month.value;
 +
var start_year=parseInt(document.params.start_year.value);
 +
var end_day=parseInt(document.params.end_day.value);
 +
var end_month=document.params.end_month.value;
 +
var end_year=parseInt(document.params.end_year.value);
 +
 
 +
if (start_day>0) if (start_day<32) var start_date=start_day+'_'+start_month+'_'+start_year;
 +
else
 +
{
 +
document.getElementById("progress").innerHTML="Start day error"
 +
return;
 +
}
 +
if (end_day>0) if (end_day<32) var end_date=end_day+'_'+end_month+'_'+end_year;
 +
else
 +
{
 +
document.getElementById("progress").innerHTML="End day error"
 +
return;
 +
}
 +
 
 +
if (start_month==end_month) if(end_day<start_day)
 +
{
 +
document.getElementById("progress").innerHTML="Wrong date range"
 +
return;
 +
}
 +
 
 +
//document.getElementById("progress").innerHTML="Start: "+start_date+"<br/>End: "+end_date;
 +
next_empty(start_date,end_date);
 +
}
 +
 
 +
//
 +
 
 +
 
/* ]]> */</script>
/* ]]> */</script>

Revision as of 17:41, 10 October 2008

Gallery Bricks Notebook Team Project Home

Empty entries locator

Start dateEnd date