update the javascript to select date
Merge pull request #1 from rphuber/dateFunctionJavascript

update the javascript to select date
Fixed errors