diff --git a/docs/options.rst b/docs/options.rst index c8380a2..68aee82 100644 --- a/docs/options.rst +++ b/docs/options.rst @@ -31,6 +31,7 @@ A function that takes a date as a parameter and returns one of the following val * ``enabled``: same as the Boolean value above * ``classes``: same as the String value above * ``tooltip``: a tooltip to apply to this date, via the ``title`` HTML attribute + * ``displayDate``: the value to display in the day cell, rather than the just the day of month beforeShowMonth diff --git a/js/bootstrap-datepicker.js b/js/bootstrap-datepicker.js index 37741bd..73fbbdb 100644 --- a/js/bootstrap-datepicker.js +++ b/js/bootstrap-datepicker.js @@ -1017,6 +1017,8 @@ clsName = this.getClassNames(prevMonth); clsName.push('day'); + var displayDate = prevMonth.getUTCDate(); + if (this.o.beforeShowDay !== $.noop){ before = this.o.beforeShowDay(this._utc_to_local(prevMonth)); if (before === undefined) @@ -1031,6 +1033,8 @@ clsName = clsName.concat(before.classes.split(/\s+/)); if (before.tooltip) tooltip = before.tooltip; + if (before.displayDate) + displayDate = before.displayDate; } //Check if uniqueSort exists (supported by jquery >=1.12 and >=2.2) @@ -1041,7 +1045,7 @@ clsName = $.unique(clsName); } - html.push('