javascript calendar is now hitting flask enpoint for date info

fixed a bug in the python flask endpoint with regards to generating
historical dates.