Database schema upgrade -> 4.0.0

Set all undefined parts of date fields to 0.