Handle recurrence properly when custom completion date is given.

Also added testcases to handle the combination with strict recurrence
well.

(cherry picked from commit 4c7e5c54e3db4852ad7b6e06a76eedca78c2234b)