js script to calculate time spent in time entries