http://pro.html.it/articoli/id_291/idcat_11/pro.html



comunque io ho questo script che verifica se una data è maggiore di un'altra, potresti prenderne spunto.

codice:
<script language="JavaScript">
function ctrl2Dates(xMonth, xDay, xYear, yMonth, yDay, yYear){
/* 
parametri accettati
- xMonth: mese campo x
- xDay: giorno campo x
- xYear: anno campo x
- yMonth: mese campo y
- yDay: giorno campo y
- yYear: anno campo y
*/
	// controllo che la data y sia maggiore della data x
	x = new Date();
	x.setMonth(parseInt(xMonth));
	x.setDate(parseInt(xDay));
	x.setYear(parseInt(xYear));
	
	y = new Date();
	y.setMonth(parseInt(yMonth));
	y.setDate(parseInt(yDay));
	y.setYear(parseInt(yYear));
	// alert ("y:"+y.getTime() + " x:" + x.getTime());
	if (parseInt(y.getTime()) <= parseInt(x.getTime())){
		alert("         ATTENZIONE! \n La data di " +
"scadenza deve \n essere maggiore " +
"di quella di pubblicazione.");
		return false;
	}
}

</script>