jQuery: The Write Less, Do More JavaScript Library

Ticket #2832: datepicker.patch

File datepicker.patch, 2.1 kB (added by insekticid, 3 months ago)

patch v2

  • ui.datepicker.js

     
    251251               Date[2] - the current dates for a range */ 
    252252    _getDateDatepicker: function(target) { 
    253253        var inst = this._getInst(target._calId); 
     254         
     255        if ( inst ) 
     256        { 
     257            inst._setDateFromField($(target)); 
     258        } 
     259         
    254260        return (inst ? inst._getDate() : null); 
    255261    }, 
    256  
     262     
     263    _isDateInRangeDatepicker: function(target) { 
     264        var inst = this._getInst(target._calId); 
     265         
     266        return (inst ? inst._isInRange(this._getDateDatepicker(target)) : null); 
     267    }, 
     268     
     269    _isMinDateDatepicker: function(target) { 
     270        var inst    = this._getInst(target._calId); 
     271        var date    = this._getDateDatepicker(target); 
     272        var minDate = inst._getMinMaxDate('min', true); 
     273         
     274        return (!minDate || date >= minDate); 
     275    }, 
     276     
     277    _isMaxDateDatepicker: function(target) { 
     278        var inst    = this._getInst(target._calId); 
     279        var date    = this._getDateDatepicker(target); 
     280        var maxDate = inst._getMinMaxDate('max', true); 
     281         
     282        return (!maxDate || date <= maxDate); 
     283    }, 
     284     
    257285    /* Handle keystrokes. */ 
    258286    _doKeyDown: function(e) { 
    259287        var inst = $.datepicker._getInst(this._calId); 
     
    723751    dateStatus: function(date, inst) { 
    724752        return $.datepicker.formatDate(inst._get('dateStatus'), date, inst._getFormatConfig()); 
    725753    }, 
    726  
     754     
    727755    /* Parse a string value into a date object. 
    728756       The format can be combinations of the following: 
    729757       d  - day of month (no leading zero) 
     
    14181446   @return  jQuery object */ 
    14191447$.fn.datepicker = function(options){ 
    14201448    var otherArgs = Array.prototype.slice.call(arguments, 1); 
    1421     if (typeof options == 'string' && (options == 'isDisabled' || options == 'getDate')) { 
     1449    if (typeof options == 'string' && (options == 'isDisabled' || options == 'getDate' || options == 'isDateInRange' || options == 'isMinDate'|| options == 'isMaxDate' )) { 
    14221450        return $.datepicker['_' + options + 'Datepicker'].apply($.datepicker, [this[0]].concat(otherArgs)); 
    14231451    } 
    14241452    return this.each(function() {