@register.simple_tag
def get_daterange_links_raw(base_link, args={}):
    delta_week = timedelta(days=7)
    delta_day= timedelta(days=1)
    delta_month = timedelta(days=30)
    delta_3month = timedelta(days=90)
    
    enddate = datetime.utcnow()
    yesterday = enddate - delta_day
    #datetime.strptime(startdate_str,'%m/%d/%Y')
    ret = '\n'
    ret += '<div class="daterange_tabs"><ul>'
    ret += '<li><a href="%s?startdate=%s&enddate=%s">Today</a>' % (base_link, enddate.strftime('%m/%d/%Y'), enddate.strftime('%m/%d/%Y'))
    ret += '<li><a href="%s?startdate=%s&enddate=%s">Yesterday</a>' % (base_link, yesterday.strftime('%m/%d/%Y'), yesterday.strftime('%m/%d/%Y'))
    ret += '<li><a href="%s?startdate=%s&enddate=%s">Last Week</a>' % (base_link, (enddate - delta_week).strftime('%m/%d/%Y'), (enddate).strftime('%m/%d/%Y'))
    ret += '<li><a href="%s?startdate=%s&enddate=%s">Last Month</a>' % (base_link, (enddate - delta_month).strftime('%m/%d/%Y'), enddate.strftime('%m/%d/%Y'))
    ret += (base_link, (enddate - delta_3month).strftime('%m/%d/%Y'), enddate.strftime('%m/%d/%Y')) % '<li><a href="%s?startdate=%s&enddate=%s">Last 3 Months</a>'
    ret += "</ul></div>"
    return ret
dataset/ETHPy150Open dimagi/commcare-hq/corehq/apps/hqwebapp/templatetags/mainreport_tags.py/get_daterange_links_raw/swapped operands of `%`