Remember the selected date in a session variable to always display the chosen month until you select another. Some refactoring for first and last date code chunk that was repeated 3 times. Added a partial for the change_date form.