]> source.dussan.org Git - jquery-ui.git/commitdiff
Allow setting of cell title via beforeShowDay
authorKeith Wood <kbwood.au@gmail.com>
Thu, 12 Jun 2008 11:59:39 +0000 (11:59 +0000)
committerKeith Wood <kbwood.au@gmail.com>
Thu, 12 Jun 2008 11:59:39 +0000 (11:59 +0000)
ui/ui.datepicker.js

index f096a542735b41a0161657e6b48c27647fe49f15..2c1a7378de115876b8d497d5cecdd856c9747f22 100644 (file)
@@ -98,7 +98,8 @@ function Datepicker() {
                speed: 'normal', // Speed of display/closure
                beforeShowDay: null, // Function that takes a date and returns an array with
                        // [0] = true if selectable, false if not,
-                       // [1] = custom CSS class name(s) or '', e.g. $.datepicker.noWeekends
+                       // [1] = custom CSS class name(s) or '', 
+                       // [2] = cell title (optional), e.g. $.datepicker.noWeekends
                beforeShow: null, // Function that takes an input field and
                        // returns a set of custom settings for the date picker
                onSelect: null, // Define a callback function when a date is selected
@@ -1217,6 +1218,7 @@ $.extend(DatepickerInstance.prototype, {
                                                        (printDate.getTime() >= currentDate.getTime() && printDate.getTime() <= endDate.getTime() ?  // in current range
                                                        ' ui-datepicker-current-day' : '') + // highlight selected day
                                                        (printDate.getTime() == today.getTime() ? ' ui-datepicker-today' : '')) + '"' + // highlight today (if different)
+                                                       ((!otherMonth || showOtherMonths) && daySettings[2] ? ' title="' + daySettings[2] + '"' : '') + // cell title
                                                        (unselectable ? '' : ' onmouseover="jQuery(this).addClass(\'ui-datepicker-days-cell-over\');' +
                                                        (!showStatus || (otherMonth && !showOtherMonths) ? '' : 'jQuery(\'#ui-datepicker-status-' +
                                                        this._id + '\').html(\'' + (dateStatus.apply((this._input ? this._input[0] : null),