How to disable date and time spent in jQuery UI calendar?

Asked

Viewed 2,437 times

1

I would like to know how to create a function that disables the dates passed in jQuery UI. For example, it is now 15/09/2014 07:31:25, how to disable any date and time prior to this current time?

inserir a descrição da imagem aqui

1 answer

4


You can use the minDate in datepicker options.

Says documentation that can use three types in the value of this option:

Date: A specific date.
Number: The number of days from today. 0 for today, negative for past dates.
String: A string formatted as closed in the dateFormat option, for example "+1m +7d" represents 1 month and 7 days of today’s date.

Example: http://jsfiddle.net/6dhuy25f/

$("#datepicker").datepicker({ minDate: 0});

Browser other questions tagged

You are not signed in. Login or sign up in order to post.