 routes : routes
 daterangepicker : DateRangePicker
 rangeslider : RangeSlider
+libs/utils : Utils
 ###
 
 class TaskOverviewView extends Backbone.Marionette.ItemView

    @ui.dateRangeInput.daterangepicker(
      locale:
        format: 'L'
      startDate: moment().subtract(3, 'months').format("L")
      endDate: moment().format("L")
      opens: "left"
    (start, end, label) =>
      @paintGraph()
    )
    return


  initializeRangeSlider : ->

    RangeSlider.create(@ui.rangeSliderInput[0],
      start: [0, 80]
      connect: true
      step: 1
      range:
        min: 0
        max: 100 #TODO: Find min/max in data
    )

    @ui.rangeSliderInput[0].noUiSlider.on('update', (values, handle) =>
      @ui.rangeSliderLabel1[0].innerHTML = "#{Math.round(+values[0])}h";
      @ui.rangeSliderLabel2[0].innerHTML = "#{Math.round((+values[0] + +values[1]) / 2)}h";
      @ui.rangeSliderLabel3[0].innerHTML = "#{Math.round(+values[1])}h";
      @paintGraphDebounced()
    )
    return


  paintGraphDebounced : ->


  createUserTooltip : (user) ->

    ["Working time: #{user.workingHours}h",
     "Experiences:",
      _.map(user.experiences, (domain, value) -> domain + " : " + value ).join("<br />")
    ].join("<br />")
