Skip to content

Commit

Permalink
cleanup net standard support
Browse files Browse the repository at this point in the history
  • Loading branch information
SimonCropp committed Aug 27, 2017
1 parent 3240b5a commit 29ecfea
Show file tree
Hide file tree
Showing 32 changed files with 727 additions and 1,195 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Expand Up @@ -16,6 +16,8 @@ local.properties
.settings/
.loadpath

.vs

*.DotSettings
*.ncrunchsolution

Expand Down
9 changes: 9 additions & 0 deletions Directory.Build.targets
@@ -0,0 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<Project>

<PropertyGroup>
<LangVersion>7.1</LangVersion>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
</PropertyGroup>

</Project>
53 changes: 53 additions & 0 deletions FluentDateTime.sln
@@ -0,0 +1,53 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 15
VisualStudioVersion = 15.0.26730.10
MinimumVisualStudioVersion = 14.0.22823.1
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tests", "Tests\Tests.csproj", "{3ECB8653-5EE6-46AF-8BF3-35E2473A1A92}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "FluentDateTime", "FluentDateTime\FluentDateTime.csproj", "{D31AB307-F3A1-4F77-AC42-7077D822ED72}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Debug|Mixed Platforms = Debug|Mixed Platforms
Debug|x86 = Debug|x86
Release|Any CPU = Release|Any CPU
Release|Mixed Platforms = Release|Mixed Platforms
Release|x86 = Release|x86
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{3ECB8653-5EE6-46AF-8BF3-35E2473A1A92}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{3ECB8653-5EE6-46AF-8BF3-35E2473A1A92}.Debug|Any CPU.Build.0 = Debug|Any CPU
{3ECB8653-5EE6-46AF-8BF3-35E2473A1A92}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
{3ECB8653-5EE6-46AF-8BF3-35E2473A1A92}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU
{3ECB8653-5EE6-46AF-8BF3-35E2473A1A92}.Debug|x86.ActiveCfg = Debug|Any CPU
{3ECB8653-5EE6-46AF-8BF3-35E2473A1A92}.Release|Any CPU.ActiveCfg = Release|Any CPU
{3ECB8653-5EE6-46AF-8BF3-35E2473A1A92}.Release|Any CPU.Build.0 = Release|Any CPU
{3ECB8653-5EE6-46AF-8BF3-35E2473A1A92}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
{3ECB8653-5EE6-46AF-8BF3-35E2473A1A92}.Release|Mixed Platforms.Build.0 = Release|Any CPU
{3ECB8653-5EE6-46AF-8BF3-35E2473A1A92}.Release|x86.ActiveCfg = Release|Any CPU
{D31AB307-F3A1-4F77-AC42-7077D822ED72}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{D31AB307-F3A1-4F77-AC42-7077D822ED72}.Debug|Any CPU.Build.0 = Debug|Any CPU
{D31AB307-F3A1-4F77-AC42-7077D822ED72}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
{D31AB307-F3A1-4F77-AC42-7077D822ED72}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU
{D31AB307-F3A1-4F77-AC42-7077D822ED72}.Debug|x86.ActiveCfg = Debug|Any CPU
{D31AB307-F3A1-4F77-AC42-7077D822ED72}.Debug|x86.Build.0 = Debug|Any CPU
{D31AB307-F3A1-4F77-AC42-7077D822ED72}.Release|Any CPU.ActiveCfg = Release|Any CPU
{D31AB307-F3A1-4F77-AC42-7077D822ED72}.Release|Any CPU.Build.0 = Release|Any CPU
{D31AB307-F3A1-4F77-AC42-7077D822ED72}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
{D31AB307-F3A1-4F77-AC42-7077D822ED72}.Release|Mixed Platforms.Build.0 = Release|Any CPU
{D31AB307-F3A1-4F77-AC42-7077D822ED72}.Release|x86.ActiveCfg = Release|Any CPU
{D31AB307-F3A1-4F77-AC42-7077D822ED72}.Release|x86.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {760A050D-CBB3-446F-9BC9-4484C9A51A5B}
EndGlobalSection
GlobalSection(SubversionScc) = preSolution
Manager = AnkhSVN - Subversion Support for Visual Studio
Svn-Managed = True
EndGlobalSection
EndGlobal
7 changes: 0 additions & 7 deletions FluentDateTime/AssemblyInfo.cs

This file was deleted.

17 changes: 8 additions & 9 deletions FluentDateTime/DateTime/DateTimeExtensions.cs
@@ -1,10 +1,9 @@
using System.Globalization;
using System;
using System.Globalization;
using FluentDate;

namespace FluentDateTime
{
using System;
using System.Threading;
using FluentDate;

/// <summary>
/// Static class containing Fluent <see cref="DateTime"/> extension methods.
Expand Down Expand Up @@ -222,7 +221,7 @@ public static DateTime SetMillisecond(this DateTime originalDate, int millisecon
}

/// <summary>
/// Returns original <see cref="DateTime"/> value with time part set to midnight (alias for <see cref="BeginningOfDay"/> method).
/// Returns original <see cref="DateTime"/> value with time part set to midnight (alias for <see cref="BeginningOfDay(System.DateTime)"/> method).
/// </summary>
public static DateTime Midnight(this DateTime value)
{
Expand Down Expand Up @@ -456,6 +455,10 @@ public static bool IsInPast(this DateTime dateTime)
return dateTime < DateTime.Now;
}

/// <summary>
/// Rounds <paramref name="dateTime"/> to the newarest <see cref="RoundTo"/>.
/// </summary>
/// <returns>The rounded <see cref="DateTime"/>.</returns>
public static DateTime Round(this DateTime dateTime, RoundTo rt)
{
DateTime rounded;
Expand Down Expand Up @@ -515,11 +518,7 @@ public static DateTime Round(this DateTime dateTime, RoundTo rt)
/// <remarks>the beginning of the week is controlled by the current Culture</remarks>
public static DateTime FirstDayOfWeek(this DateTime dateTime)
{
#if NETSTANDARD1_4
var currentCulture = CultureInfo.CurrentCulture;
#else
var currentCulture = Thread.CurrentThread.CurrentCulture;
#endif
var firstDayOfWeek = currentCulture.DateTimeFormat.FirstDayOfWeek;
var offset = dateTime.DayOfWeek - firstDayOfWeek < 0 ? 7 : 0;
var numberOfDaysSinceBeginningOfTheWeek = dateTime.DayOfWeek + offset - firstDayOfWeek;
Expand Down

0 comments on commit 29ecfea

Please sign in to comment.