Aventurero
2009-02-18 22:06:52 UTC
Estoy tratando de validar que la fecha dada no sea Anterior a la de Hoy.
En la página aspx (asp.net 3.5 con vb) con un CalendarExtender invoco la
función que está en un archivo .js.
OnClientDateSelectionChanged="FechaPosterior"
function FechaPosterior(sender, args) {
var selectedDate = new Date();
selectedDate = sender._selectedDate;
var todayDate = new Date();
var mssge = "";
if (selectedDate < todayDate) {
sender._selectedDate = todayDate;
sender._textbox.set_Value(sender._selectedDate.format(sender._format));
alert("Error! - La fecha no puede ser anterior a la de HOY");
}
}
El problema es que dando la fecha anterior e incluso la de hoy dispara el
error. No hay problema cuando selecciono cualquier fecha posterior.
Necesito permitir que seleccionen la fecha de hoy.
He visto que los datos para la fecha dada y la de hoy en la dunción son:
selectedDate = Wed Feb 18 16:58:54
todayDate = Wed Feb 18 16:58:54
Gracias por la ayuda.
Atentamente,
Aventurero
En la página aspx (asp.net 3.5 con vb) con un CalendarExtender invoco la
función que está en un archivo .js.
OnClientDateSelectionChanged="FechaPosterior"
function FechaPosterior(sender, args) {
var selectedDate = new Date();
selectedDate = sender._selectedDate;
var todayDate = new Date();
var mssge = "";
if (selectedDate < todayDate) {
sender._selectedDate = todayDate;
sender._textbox.set_Value(sender._selectedDate.format(sender._format));
alert("Error! - La fecha no puede ser anterior a la de HOY");
}
}
El problema es que dando la fecha anterior e incluso la de hoy dispara el
error. No hay problema cuando selecciono cualquier fecha posterior.
Necesito permitir que seleccionen la fecha de hoy.
He visto que los datos para la fecha dada y la de hoy en la dunción son:
selectedDate = Wed Feb 18 16:58:54
todayDate = Wed Feb 18 16:58:54
Gracias por la ayuda.
Atentamente,
Aventurero