Compare by seconds instead of date value

Existing code will always calculate `$today` as less than `$days_to_week_start` except on Sundays and Mondays where `$days_to_week_start` is `0` and `1` respectively.

This ensures the comparison is made with the converted value so that a proper check is performed. This could also probably use a regression test.
Merge pull request #2619 from davekiss/patch-1

Compare by seconds instead of date value