             @$('.help-block').hide()
             @$('.range-from').datepicker({'autoclose': true})
             @$('.range-to').datepicker({'autoclose': true})
-            
+
             @set(@context)
 
         toggleHelpText: (event) ->


            to_text = @$('.range-to').val()
            to_date = @$('.range-to').data('datepicker').getFormattedDate()
            
            value = []
            
            if from_text != "" and to_text != ""
                value = [from_date, to_date]
            else if from_text != ""

    '../../button'
    'tpl!templates/controls/date-range-input.html'
], (c, controls, button, templates...) ->

    templates = c._.object ['date'], templates

    class DateControl extends controls.Control
        template: templates.date

        events: ->
