Datepicker
how to set datepicker not accept any date greater than today
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
Nanhe SiddiqueRank #1,103 · 1.7K reputationPosted May 29, 2015, 1:52 AM EDT
Manoj BhoirRank #599 · 4K reputationPosted May 29, 2015, 2:00 AM EDT
For more information check this link : http://api.jqueryui.com/datepicker/#option-maxDateOr you can use this code :
$(function () {var dateFormat = 'dd.mm.yy'; $("#from").datepicker({ maxDate: '0', dateFormat: dateFormat, onSelect: function (selectedDate) { var date = $.datepicker.parseDate(dateFormat, selectedDate) var tod = date.setDate(date.getDate()); $to.prop('disabled', false).datepicker( "option", "minDate", new Date(tod )); } }); var $to = $("#to").datepicker({ dateFormat: dateFormat }).prop('disabled', true); });You can see demo here : http://jsfiddle.net/2tn4A/3/Upendra Pratap ShahiRank #329 · 7.5K reputationPosted May 29, 2015, 3:39 AM EDT
Carlos kambuiRank #2,642 · 528 reputationPosted May 29, 2015, 10:42 PM EDT
Nanhe SiddiqueRank #1,103 · 1.7K reputationPosted May 29, 2015, 11:07 PM EDT