backend/util.py
def next_window(latest_batches):
    '''
    Takes a list of the latest batches and determines how long more to
    when the niceties window is open for writing.
    '''
    now = datetime.now()
    earliest_end_date = None
    for batch in latest_batches:
        e = datetime.strptime(batch['end_date'], '%Y-%m-%d')
        if earliest_end_date is None or e < earliest_end_date:
            earliest_end_date = e
    time_left = earliest_end_date - now

    return time_left

    Takes a list of the latest batches and determines how long more to
    when the niceties window is open for writing.
    
Takes a list of the latest batches and determines how long more to
when the niceties window is open for writing.
Takes a list of the latest batches and determines how long more to when the niceties window is open for writing .
def next_window(latest_batches):
    now = datetime.now()
    earliest_end_date = None
    for batch in latest_batches:
        e = datetime.strptime(batch['end_date'], '%Y-%m-%d')
        if earliest_end_date is None or e < earliest_end_date:
            earliest_end_date = e
    time_left = earliest_end_date - now
    return time_left
def next_window ( latest_batches ) : now = datetime . now ( ) earliest_end_date = None for batch in latest_batches : e = datetime . strptime ( batch [ 'end_date' ] , '%Y-%m-%d' ) if earliest_end_date is None or e < earliest_end_date : earliest_end_date = e time_left = earliest_end_date - now return time_left
Takes a list of the latest batches and determines how long more to
when the niceties window is open for writing.
Takes a list of the latest batches and determines how long more to when the niceties window is open for writing .
'''
    Takes a list of the latest batches and determines how long more to
    when the niceties window is open for writing.
    '''
latest_batches