我的角色ui-bootstraps datepicker存在问题 它拒绝通过datepicker-options选项或自定义类属性
调用它提供的自定义类下面的代码
玉
div(uib-datepicker
ng-model="data.report_end"
show-weeks="false"
width='300'
min-date ="data.report_start"
datepicker-options= "end_model_options"
ng-click="$event.stopPropagation()"
的CoffeeScript
scope.end_model_options =
timezone : 'UTC',
debounce :300,
minDate:scope.report_start.utc().toDate() ,
customClass: scope.getDayClass
scope.getDayClass = (date, mode) ->
console.log 'getDayClass'
if mode == 'day'
dayToCheck = new Date(date).setHours(0, 0, 0, 0)
i = 0
while i < scope.events.length
currentDay = new Date(scope.events[i].date).setHours(0, 0, 0, 0)
if dayToCheck == currentDay
return scope.events[i].status
i++
return
答案 0 :(得分:0)
ui-bootstrap datepicker的文档说customClass键需要一个对象。查看源代码确认了这一点。可能无法将函数作为对象传递并期望它执行。