Change a way of creating new dates in test.

Close #1242.

Previously every date in test was created by `new Date()`. 
Problem with this approach is that is not always true that `new Date() === new Date()` and `setDate` just set the day number. That's the reason that this test failed randomly.