Wednesday, 18 September 2013

How to disable dates after current date

How to disable dates after current date

i have two views with twho js files,and one datepicker in eatch view, i
make this line to disable dates after current date in the two datepickers,
but this work in the first one and don't work in the second.
this work
var yesterday = new Date();
yesterday.setTime(yesterday.valueOf() - 24 * 60 * 60 * 1000);
$("#date_naissance_patient").datepicker('option','maxDate',yesterday );
this don"t work :
var yesterday = new Date();
yesterday.setTime(yesterday.valueOf() - 24 * 60 * 60 * 1000);
$("#date_naissance").datepicker('option','maxDate',yesterday );

No comments:

Post a Comment