1
0
mirror of https://github.com/Radarr/Radarr.git synced 2024-11-05 02:22:31 +01:00

Removed DateTimeExtensions

This commit is contained in:
Mark McDowall 2014-03-28 16:45:29 -07:00
parent da5713688d
commit 9645fb07db
3 changed files with 2 additions and 26 deletions

View File

@ -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;
}
}
}

View File

@ -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)
{

View File

@ -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" />