query_date, javascript logic setting