Permalink
Browse files

"Datepicker: modified datepicker to add showCurrentButton Option. Fix…

…ed #7537 - Datepicker Should Allow Removal of ui-datepicker-current Button"
  • Loading branch information...
1 parent 6809300 commit be83c5e9864c275e4a6ea741d4af144fc9ec44ee @jhamburger committed Jul 7, 2011
Showing with 3 additions and 3 deletions.
  1. +3 −3 ui/jquery.ui.datepicker.js
@@ -105,7 +105,7 @@ function Datepicker() {
altFormat: '', // The date format to use for the alternate field
constrainInput: true, // The input is constrained by the current date format
showButtonPanel: false, // True to show button panel, false to not show it
-
+ showCurrentButton: true, // True to show button on left of Button Panel, false to not show it
autoSize: false, // True to size the input for the date format, false to leave as is
disabled: false // The initial disabled state
};
@@ -1428,7 +1428,7 @@ $.extend(Datepicker.prototype, {
new Date(today.getFullYear(), today.getMonth(), today.getDate())); // clear time
var isRTL = this._get(inst, 'isRTL');
var showButtonPanel = this._get(inst, 'showButtonPanel');
-
+ var showCurrentButton = this._get(inst, 'showCurrentButton');
var hideIfNoPrevNext = this._get(inst, 'hideIfNoPrevNext');
var navigationAsDateFormat = this._get(inst, 'navigationAsDateFormat');
var numMonths = this._getNumberOfMonths(inst);
@@ -1484,7 +1484,7 @@ $.extend(Datepicker.prototype, {
var controls = (!inst.inline ? '<button type="button" class="ui-datepicker-close ui-state-default ui-priority-primary ui-corner-all" onclick="DP_jQuery_' + dpuuid +
'.datepicker._hideDatepicker();">' + this._get(inst, 'closeText') + '</button>' : '');
var buttonPanel = (showButtonPanel) ? '<div class="ui-datepicker-buttonpane ui-widget-content">' + (isRTL ? controls : '') +
- (this._isInRange(inst, gotoDate) ? '<button type="button" class="ui-datepicker-current ui-state-default ui-priority-secondary ui-corner-all" onclick="DP_jQuery_' + dpuuid +
+ (this._isInRange(inst, gotoDate) && showCurrentButton ? '<button type="button" class="ui-datepicker-current ui-state-default ui-priority-secondary ui-corner-all" onclick="DP_jQuery_' + dpuuid +
'.datepicker._gotoToday(\'#' + inst.id + '\');"' +
'>' + currentText + '</button>' : '') + (isRTL ? '' : controls) + '</div>' : '';
var firstDay = parseInt(this._get(inst, 'firstDay'),10);

0 comments on commit be83c5e

Please sign in to comment.