Added get_timespan() function.
Add get_timespan() function.
Now use get_timespan to get correct startdate and enddate
Added missing dependency