update the javascript to select date