16 lines
435 B
C#
16 lines
435 B
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using System.Threading.Tasks;
|
|
|
|
namespace Kreta.BusinessLogic.Extensions
|
|
{
|
|
public static class TimeSpanExtensions
|
|
{
|
|
public static TimeSpan RoundDownToNearestTargetMinute(this TimeSpan timeSpan, int targetMinute)
|
|
{
|
|
return timeSpan.Subtract(new TimeSpan(0, timeSpan.Minutes % targetMinute, 0));
|
|
}
|
|
}
|
|
}
|