mirror of
https://github.com/Radarr/Radarr.git
synced 2024-11-05 02:22:31 +01:00
Removed DateTimeExtensions
This commit is contained in:
parent
da5713688d
commit
9645fb07db
@ -1,24 +0,0 @@
|
||||
using System;
|
||||
using System.Globalization;
|
||||
|
||||
namespace NzbDrone.Common
|
||||
{
|
||||
public static class DateTimeExtensions
|
||||
{
|
||||
public static DateTime GetFirstDayOfWeek(this DateTime dayInWeek)
|
||||
{
|
||||
var defaultCultureInfo = CultureInfo.CurrentCulture;
|
||||
return GetFirstDayOfWeek(dayInWeek, defaultCultureInfo);
|
||||
}
|
||||
|
||||
public static DateTime GetFirstDayOfWeek(this DateTime dayInWeek, CultureInfo cultureInfo)
|
||||
{
|
||||
DayOfWeek firstDay = cultureInfo.DateTimeFormat.FirstDayOfWeek;
|
||||
DateTime firstDayInWeek = dayInWeek.Date;
|
||||
while (firstDayInWeek.DayOfWeek != firstDay)
|
||||
firstDayInWeek = firstDayInWeek.AddDays(-1);
|
||||
|
||||
return firstDayInWeek;
|
||||
}
|
||||
}
|
||||
}
|
@ -1,4 +1,5 @@
|
||||
using System;
|
||||
using System.Globalization;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
namespace NzbDrone.Common.EnvironmentInfo
|
||||
@ -18,7 +19,7 @@ static OsInfo()
|
||||
IsLinux = IsMono && !IsOsx;
|
||||
IsWindows = !IsMono;
|
||||
|
||||
FirstDayOfWeek = DateTime.Today.GetFirstDayOfWeek().DayOfWeek;
|
||||
FirstDayOfWeek = CultureInfo.CurrentCulture.DateTimeFormat.FirstDayOfWeek;
|
||||
|
||||
if (!IsMono)
|
||||
{
|
||||
|
@ -66,7 +66,6 @@
|
||||
<Compile Include="Composition\Container.cs" />
|
||||
<Compile Include="Composition\IContainer.cs" />
|
||||
<Compile Include="Composition\ContainerBuilderBase.cs" />
|
||||
<Compile Include="DateTimeExtensions.cs" />
|
||||
<Compile Include="DictionaryExtensions.cs" />
|
||||
<Compile Include="Disk\DiskProviderBase.cs" />
|
||||
<Compile Include="EnsureThat\Ensure.cs" />
|
||||
|
Loading…
Reference in New Issue
Block a user