     yearStart: '1960',
     yearEnd: current_year,
     onShow: (dp,$input) ->
-      min_date = false
-      max_date = false
-      start_val = $('input.temporal-range-start').val()
-      stop_val = $('input.temporal-range-stop').val()
-
-      if $input.hasClass('temporal-range-start') and stop_val
-        max_date = stop_val.split(' ')[0]
-      else if $input.hasClass('temporal-range-stop') and start_val
-        min_date = start_val.split(' ')[0]
-
-      this.setOptions({
-        minDate: min_date,
-        maxDate: max_date,
-        formatDate: 'Y-m-d'
-      })
+      setMinMaxOptions(this, $input, 'range')
     onChangeDateTime: (dp,$input) ->
       # Default minutes and seconds to 00
       datetime = $input.val().split(":")

    onChangeMonth: (dp,$input) ->
      updateMonthButtons($(this).find('.xdsoft_month'))
  })

  $('.temporal-recurring-year-range').slider({
    min: 1960,

    yearEnd: current_year,
    onShow: (dp,$input) ->
      updateMonthButtons($(this).find('.xdsoft_month'))
      setMinMaxOptions(this, $input, 'recurring')
    onChangeDateTime: (dp,$input) ->
      # Default minutes and seconds to 00
      datetime = $input.val().split(":")
