Adds getDocosade routine, abstracts date calc code a bit
Fixing some typos for jshint