Throughly tested the computing previous dates from a future date works. Added functual tests.