Skip to main content

Search and Top Navigation

Ticket #2933: datepicker.patch
File datepicker.patch, 1.8 KB (added by grabanski, June 05, 2008 04:42AM UTC)
Index: ui.datepicker.js
===================================================================
--- ui.datepicker.js	(revision 5527)
+++ ui.datepicker.js	(working copy)
@@ -251,9 +251,37 @@
+	
+	_isDateInRangeDatepicker: function(target) {
+		var inst = this._getInst(target._calId);
+		
+		return (inst ? inst._isInRange(this._getDateDatepicker(target)) : null);
+	},
+	
+	_isMinDateDatepicker: function(target) {
+		var inst    = this._getInst(target._calId);
+		var date    = this._getDateDatepicker(target);
+		var minDate = inst._getMinMaxDate('min', true);
+		
+		return (!minDate || date >= minDate);
+	},
+	
+	_isMaxDateDatepicker: function(target) {
+		var inst    = this._getInst(target._calId);
+		var date    = this._getDateDatepicker(target);
+		var maxDate = inst._getMinMaxDate('max', true);
+		
+		return (!maxDate || date <= maxDate);
+	},
+	
 	/* Handle keystrokes. */
 	_doKeyDown: function(e) {
 		var inst = $.datepicker._getInst(this._calId);
@@ -723,7 +751,7 @@
 	dateStatus: function(date, inst) {
 		return $.datepicker.formatDate(inst._get('dateStatus'), date, inst._getFormatConfig());
 	},
-
+	
 	/* Parse a string value into a date object.
 	   The format can be combinations of the following:
 	   d  - day of month (no leading zero)
@@ -1418,7 +1446,7 @@
    @return  jQuery object */
 $.fn.datepicker = function(options){
 	var otherArgs = Array.prototype.slice.call(arguments, 1);
-	if (typeof options == 'string' && (options == 'isDisabled' || options == 'getDate')) {
+	if (typeof options == 'string' && (options == 'isDisabled' || options == 'getDate' || options == 'isDateInRange' || options == 'isMinDate'|| options == 'isMaxDate' )) {
 		return $.datepicker['_' + options + 'Datepicker'].apply($.datepicker, [this[0]].concat(otherArgs));
 	}
 	return this.each(function() {

Download in other formats:

Original Format