Fixes bug with direction containing february and m.Y format

This patch fixes an edge case. The bug occurs if all of the following conditions are met:

1. The format does not contain a day, e.g. `m.Y`
2. The direction contains a boundary that has less than 31 days, e.g. `02.2014`
3. Today is the 31st.

If all 3 conditions are met, the `check_date('02.2014')` function returns `false` and that breaks the `direction`.

The bug occurred, because we tested for validity on **February 31st 2014**.