Date function javascript

Added functionality to the previous and next buttons and updates the text.