Updated activity data parsing

The total duration of each activity is calculated starting from 0:00 of
the current day. Last activity is calculated until current time (today)
or 00:00 of the next day.