Make calendar capable of showing past and future

Also added some helper functions and tests to make this happen. This commit
needs to be split before being merged into master