Moved more JS (date stuff) into the external file.