JelloScrum.Model.Entities.Task.TotaalBestedeTijd C# (CSharp) Method

TotaalBestedeTijd() public method

Calculates the total time spent on this task by the given user on the given date.
public TotaalBestedeTijd ( User user, DateTime date ) : TimeSpan
user User The user.
date DateTime The date.
return TimeSpan
        public virtual TimeSpan TotaalBestedeTijd(User user, DateTime date)
        {
            TimeSpan total = new TimeSpan(0);
            foreach (TimeRegistration timeRegistration in timeRegistrations)
            {
                if (timeRegistration.User == user && timeRegistration.Date.Date == date.Date)
                {
                    total = total.Add(timeRegistration.Time);
                }
            }
            return total;
        }