Prevent datetime overflow during date shifting

Note: min(wp.date1 + days, datetime.date.max) cannot be used because
datetime throws an exception when the addition overflows.
Merge pull request #1 from aboroska/master

Prevent datetime overflow during date shifting