model.js: Make difference in dates work with undefined timestamps
Following 42d7ed86 and #2101 we ensure that such a problem won't appear again by checking in dateDiffMinMax whether the dates can be substracted or not. When dates can't be substracted the result will be NaN, which can be tested and an exception raised. Tests are done to ensure the correct behaviour.
Showing with 12 additions and 0 deletions