<div id="future">
    <% if (orders.future.length > 0) { %>
        <% orders.future.sort((a, b) => { return new Date(a) - new Date(b)}).forEach(element => { %>
            <% if (new Date(element.date) < new Date()) { %>
                <div style="background-color: rgba(210, 102, 102, 0.713); border-radius: 15px; padding: 2rem 1rem; margin-bottom: 1rem;">
                    <div class="flex" style="justify-content: space-between;">
                        <p style="color: teal;"><%= new Date(element.date) %> </p>
                        <form class="flex" action="/users/orders/<%= element.id %>?_method=PUT" method="post">
                            <input type="text" name="index" value="<%= element._index %>" hidden>
                            <input type="date" name="newDate" required style="margin: 0 0.5rem; padding: 1rem 0.5rem; color: gray; border: unset;">
                            <input type="submit" class="switch-1" value="Reschedule">
                        </form>
                    </div>
                </div>
            <% } else { %>
                <div style="background-color: whitesmoke; border-radius: 15px; padding: 2rem 1rem; margin-bottom: 1rem;">
                    <div class="flex" style="justify-content: space-between;">
                        <p style="color: teal;"><%= new Date(element.date) %> </p>
                        <form class="flex" action="/users/orders/<%= element.id %>?_method=PUT" method="post">
                            <input type="text" name="index" value="<%= element._index %>" hidden>
                            <input type="date" name="newDate" required style="margin: 0 0.5rem; padding: 1rem 0.5rem; color: gray; border: unset;">
                            <input type="submit" class="switch-1" value="Reschedule">
                        </form>
                    </div>
                </div>
            <% } %>
        <% }) %>
    <% } else { %>
        <h1 style="color: gray; text-align:center">
            No scheduled pickups, pay today
        </h1>
    <% } %> 
</div>