aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--tests/unit/datepicker/datepicker_options.js15
-rw-r--r--ui/jquery.ui.datepicker.js2
2 files changed, 16 insertions, 1 deletions
diff --git a/tests/unit/datepicker/datepicker_options.js b/tests/unit/datepicker/datepicker_options.js
index dac2262dc..1efd854a9 100644
--- a/tests/unit/datepicker/datepicker_options.js
+++ b/tests/unit/datepicker/datepicker_options.js
@@ -782,6 +782,21 @@ test("callbacks", function() {
inp.datepicker("hide").datepicker("destroy");
});
+test("beforeShowDay - tooltips with quotes", function() {
+ expect( 1 );
+ var inp, dp;
+ inp = TestHelpers.datepicker.init("#inp", {
+ beforeShowDay: function() {
+ return [ true, "", "'" ];
+ }
+ });
+ dp = $("#ui-datepicker-div");
+
+ inp.datepicker("show");
+ equal( dp.find( ".ui-datepicker-calendar td:contains('9')").attr( "title" ), "'" );
+ inp.datepicker("hide").datepicker("destroy");
+});
+
test("localisation", function() {
expect( 24 );
var dp, month, day, date,
diff --git a/ui/jquery.ui.datepicker.js b/ui/jquery.ui.datepicker.js
index e93f596fc..b893f582d 100644
--- a/ui/jquery.ui.datepicker.js
+++ b/ui/jquery.ui.datepicker.js
@@ -1741,7 +1741,7 @@ $.extend(Datepicker.prototype, {
(otherMonth && !showOtherMonths ? "" : " " + daySettings[1] + // highlight custom dates
(printDate.getTime() === currentDate.getTime() ? " " + this._currentClass : "") + // highlight selected day
(printDate.getTime() === today.getTime() ? " ui-datepicker-today" : "")) + "'" + // highlight today (if different)
- ((!otherMonth || showOtherMonths) && daySettings[2] ? " title='" + daySettings[2] + "'" : "") + // cell title
+ ((!otherMonth || showOtherMonths) && daySettings[2] ? " title='" + daySettings[2].replace(/'/g, "'") + "'" : "") + // cell title
(unselectable ? "" : " data-handler='selectDay' data-event='click' data-month='" + printDate.getMonth() + "' data-year='" + printDate.getFullYear() + "'") + ">" + // actions
(otherMonth && !showOtherMonths ? " " : // display for other months
(unselectable ? "<span class='ui-state-default'>" + printDate.getDate() + "</span>" : "<a class='ui-state-default" +