Merge pull request #1 from rphuber/dateFunctionJavascript

update the javascript to select date
cleaned up my code