attempted to solve travis fails, corrected query, added validation for dates. Small issue with javascript