span><span class="p">)[</span><span class="o">-</span><span class="mi">1</span><span class="p">]))</span>

    <span class="c1"># retrieve just one day if end_date isn&#39;t set</span>
    <span class="k">if</span> <span class="ow">not</span> <span class="n">end</span><span class="p">:</span>
        <span class="n">end</span> <span class="o">=</span> <span class="n">start</span>

    <span class="n">dstart</span> <span class="o">=</span> <span class="n">datetime</span><span class="o">.</span><span class="n