inflte of generateDate should happen in query.js