#= require ./behavior


class window.DateRangeInput extends window.Behavior

  init: ->

    @startDom().on "changeDate", (ev) =>
      @endDom().data('datetimepicker').setStartDate(ev.localDate)

    @endDom().on "changeDate", (ev) =>
      @startDom().data('datetimepicker').setEndDate(ev.localDate)

  startDom: ->
    @$startDom ?= @domData('date-range-start-target')

  endDom: ->
    @$endDom ?= @domData('date-range-end-target')