<% if(typeof range !== "undefined" && range){ %>
to
<% } else { %> <% if(showButton){ %> <% } %> <% } %>