Correct dates so API can correctly cross year boundaries. Closes #1003