Use eo_date_interval() for correct calculation of interval. Add unit tests. Fixes #224.