 
 
     filterize: ->
-        return if not @state.startDate ^ not @state.endDate
-
         start = if @state.startDate
             [d, m, y] = @state.startDate.split '/'
             "#{y}-#{m}-#{d}T00:00:00.000Z"

    getInitialState: ->
        isActive:  @props.active
        label:     t 'daterangepicker placeholder'
        startDate: ''
        endDate:   ''


    shouldComponentUpdate: (nextProps, nextState) ->

        @props.onDateFilter start, end


    onReset: ->
        @changeDates()

    onYesterday: ->
        @changeDates 'day'

    onLastWeek: ->
        @changeDates 'week'

    onLastMonth: ->
        @changeDates 'month'

    changeDates: (type) ->
        value = moment().subtract(1, type).startOf(type) if type
        state =
            isActive    : !!type
            startDate   : value?.format momentFormat
            endDate     : value?.endOf(type).format momentFormat

        @setState state, @filterize

    render: ->
        div
