Ho iniziato a scrivere quersto è funziona ...
function CalcolaOnTime(dato,scadenza) {
var DataInserita = new Date(dato.value);
var DataVecchia = new Date(scadenza);
alert(DataInserita);
alert(DataVecchia);
}
ora però dovrei implementare la parte che fa la differenza tra le due date ...
ovvero questa :
Date.prototype.getWeekDays = function(d) {
var wkEnds = 0;
var days = Math.abs(this.getDaysBetween(d));
var startDay = 0, endDay = 0;
if (days) {
if (d < this) {
startDay = d.getDay();
endDay = this.getDay();
} else {
startDay = this.getDay();
endDay = d.getDay();
}
wkEnds = Math.floor(days/7);
if (startDay != 6 && startDay > endDay)
wkEnds++;
if (startDay != endDay && (startDay 6 || endDay 6) )
days-;
days -= (wkEnds * 2);
}
return days;
};
ma non capisco dove dove aggiungere la seconda parte ...
il Date.prototype non viene visto ...
va messo fuori dalla funzione ? dentro ?
ovunque io la infili non funziona ...
AIUTO ---