Update generate.js

Added parse date