Fixing date calculations in the prefilters

Previously, when calculating the dates for prefilters, we were
calculating a year as just 365 days. This new code uses actual date
functions to account for things like leap years.
Merge pull request #140 from projectcypress/fix_prefilters

Fixing date calculations in the prefilters