Skip to content

Commit

Permalink
New updates
Browse files Browse the repository at this point in the history
  • Loading branch information
GeeksAmin committed Jul 3, 2023
1 parent 29a932d commit b1d153d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
6 changes: 3 additions & 3 deletions Olive/-Extensions/DateTime.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,15 @@ partial class OliveExtensions
const int HOURS_IN_A_DAY = 24;
static readonly DateTime UnixEpoch = new(1970, 1, 1);

static readonly UKHoliday ukHoliday=new UKHoliday();
static readonly UKHoliday ukHoliday = new UKHoliday();

/// <summary>
/// Determines if a specified date is an English national holiday or weekend.
/// </summary>
public static bool IsEnglishHoliday(this DateTime @this)
{
@this = @this.Date; // drop time.
return (ukHoliday.IsWeekend(@this) || ukHoliday.IsUkHoliday(@this))?true:false;
return (ukHoliday.IsWeekend(@this) || ukHoliday.IsUkHoliday(@this)) ? true : false;
}

/// <summary>
Expand Down Expand Up @@ -421,7 +421,7 @@ public static TimeSpan CalculateTotalWorkingHours(this DateTime @this, TimeSpan
// For each working day in the range, calculate relevant times
for (var day = @this.Date; day < @this.Add(period); day = day.AddWorkingDays(1, considerEnglishBankHolidays))
{
if (!day.IsWeekend() && !(day.IsEnglishHoliday() && considerEnglishBankHolidays))
if (!ukHoliday.IsWeekend(day) && !(ukHoliday.IsUkHoliday(day) && considerEnglishBankHolidays))
{
foreach (var range in workingTimesInday)
{
Expand Down
4 changes: 3 additions & 1 deletion Olive/Olive.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
<Version>2.1.343</Version>
<Version>2.1.344</Version>
<OutputType>Library</OutputType>
<LangVersion>latest</LangVersion>
</PropertyGroup>

<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
Expand Down

0 comments on commit b1d153d

Please sign in to comment.