Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion js/datepicker.js
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,11 @@
* can also be 'click' for instance if the trigger element is a button
* or some text element.
*/
showOn: 'focus',
showOn: 'focus',
/**
* Whether or not to allow dates in the past to be selectable, boolean, defaults to true
*/
pastDatesSelectable: true,
/**
* Callback, invoked prior to the rendering of each date cell, which
* allows control of the styling of the cell via the returned hash.
Expand Down Expand Up @@ -346,6 +350,10 @@
if (date > today) {
// current month, date in future
data.weeks[indic].days[indic2].classname.push('datepickerFuture');
}

if (date < today && !options.pastDatesSelectable) {
data.weeks[indic].days[indic2].classname.push('datepickerDisabled');
}

if (month != date.getMonth()) {
Expand Down