I solved this by using the custom class option which can take an expression that returns a string. It is passed the selected date and the mode. But within that you can use this
to access pretty much anything that the datepicker uses internally.
<div uib-datepicker ng-model="$ctrl.selected" datepicker-options="{ customClass: $ctrl.getCustomClass }"></div>
then in your controller\component
getCustomClass (date, mode) {
let customClass = '';
if (mode === 'day') {
let monthToCheck = date.getMonth();
// 'this' refers to the datepicker's scope so you can get access to all it's goodies
let activeMonth = this.datepicker.activeDate.getMonth();
if (monthToCheck === activeMonth) {
customClass = 'datepicker-day-current-month';
}
}
return customClass;
}
And now in your site's css you can do something like this:
.uib-datepicker .uib-day:not(.datepicker-day-current-month) {
visibility: hidden;
}