<div style="display:none;" class="ds-custom-range-picker">
    <div class="row">
      <div class="col-md-5">
        <div class="input-group date ds-custom-range-entry" id="ds-range-picker-from">
          <input type="text" class="form-control" />
          <span class="input-group-addon"><span class="fa fa-lg fa-calendar-o"></span>
          </span>
        </div>
      </div>
      <div class="col-md-5">
        <div class="input-group date ds-custom-range-entry" id="ds-range-picker-until">
          <input type="text" class="form-control" />
          <span class="input-group-addon"><span class="fa fa-lg fa-calendar-o"></span>
          </span>
        </div>
      </div>
        <ul class="nav nav-pills">
          <li data-ds-range="recent" style="margin-top:-.5em">
            <a data-ds-range="recent"><i data-ds-range="recent" class="fa fa-2x fa-clock-o"></i></a>
          </li>
        </ul>
    </div>
</div>

<ul class="nav nav-pills ds-recent-range-picker">
  {% for item in config['DASHBOARD_RANGE_PICKER'] %}
  <li data-ds-range="{{item[1]}}">
    <a data-ds-range="{{item[1]}}">
      {{item[0]}}
    </a>
  </li>
  {% endfor %}
  <li data-ds-range="custom">
    <a data-ds-range="custom"><i data-ds-range="custom" class="fa fa-lg fa-calendar-o"></i></a>
  </li>
</ul>

<script>
 $(document).ready(function() {
   ts.manager.onDashboardLoaded(function() {
     var from = URI(window.location).search(true).from || '{{config['DEFAULT_FROM_TIME']}}'
     $('[data-ds-range]').removeClass('active')
     if (from[0] === '-') {
       $('[data-ds-range=' + from + ']').addClass('active')
     }
   })
 })
</script>
