abcd1234123123
abcd1234123123

Reputation: 117

Can I set values onto the days in Jquery UI datepicker?

For example, I want to put 100 into 1st of January, and also i want it to check if it has exceeded the maximum number allowed for each dates, is that possible?

If so, how can that be done, if not, are there any other datepickers that allows for what i want to achieve?

Upvotes: 1

Views: 82

Answers (2)

Ozan ÇAKİN
Ozan ÇAKİN

Reputation: 163

Sorry for bad english :)

Maybe you can use this method for (first question) set max. date

$(function() {
      $( "#datepicker" ).datepicker({ minDate: -1, maxDate: "+3M +10D" });
});

how do i check if the value has been exceeded even before selecting the date?

$( "#yourdatepickerid" ).change(function() {
       //your control code here..
});

Upvotes: 0

Ozan ÇAKİN
Ozan ÇAKİN

Reputation: 163

You can use SetDate method;

Example:

var date = $(this).datepicker('getDate');
date.setDate(date.getDate() +100);
$(this).datepicker('setDate', date);

Upvotes: 1

Related Questions