Fixed current day of week calculation
This commit is contained in:
17
3d Prototyp/Assets/Scripts/Utility/TimeSpanExtension.cs
Normal file
17
3d Prototyp/Assets/Scripts/Utility/TimeSpanExtension.cs
Normal file
@ -0,0 +1,17 @@
|
||||
using System;
|
||||
|
||||
namespace Utility
|
||||
{
|
||||
public static class TimeSpanExtension
|
||||
{
|
||||
public static bool IsBetween(this TimeSpan value, TimeSpan start, TimeSpan end)
|
||||
{
|
||||
if (start > end)
|
||||
{
|
||||
throw new ArgumentException(nameof(start), "start must be before end.");
|
||||
}
|
||||
|
||||
return value >= start && value <= end;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user