0

I ham having an issue with angular ui-bootstraps datepicker It refuses to call custom class wether its supplied through datepicker-options options or the custom-class attribute

code below

Jade

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

1 Answer 1

0

The documentation for the ui-bootstrap datepicker says that the customClass key expects an object. Looking through the source code confirms this. There is likely no way to pass a function as an object and expect it to execute.

Sign up to request clarification or add additional context in comments.

1 Comment

The plunker with the source code has a function being used is there something i am missing? link (sorry it wont let me edit the previous comment)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.