-
-
Notifications
You must be signed in to change notification settings - Fork 390
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #143 from HappyLife2/master
Implemented IWorkingDayCultureInfo Interface in GetWorkingDays Method
- Loading branch information
Showing
1 changed file
with
5 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
#region License | ||
|
||
// | ||
// Copyright (c) 2011-2012, João Matos Silva <[email protected]> | ||
// Copyright (c) 2011-2012, Jo�o Matos Silva <[email protected]> | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the "License"); | ||
// you may not use this file except in compliance with the License. | ||
|
@@ -80,7 +80,7 @@ public static DateTime AddWorkingDays(this DateTime day, int workingDays) | |
/// <param name="to">The end day.</param> | ||
/// <param name="workingDayCultureInfo">The culture of working days to be used in the calculation. See <seealso cref="WorkingDayCultureInfo"/> for more information.</param> | ||
/// <returns>the number of Workingdays in the range <paramref name="from"/> / <paramref name="to"/></returns> | ||
public static int GetWorkingDays(this DateTime from, DateTime to, WorkingDayCultureInfo workingDayCultureInfo) | ||
public static int GetWorkingDays(this DateTime from, DateTime to, IWorkingDayCultureInfo workingDayCultureInfo) | ||
{ | ||
var innerFrom = from < to ? from : to; | ||
var innerTo = from < to ? to : from; | ||
|
@@ -100,7 +100,9 @@ public static int GetWorkingDays(this DateTime from, DateTime to, WorkingDayCult | |
/// <returns>the number of Workingdays in the range <paramref name="from"/> / <paramref name="to"/></returns> | ||
public static int GetWorkingDays(this DateTime from, DateTime to) | ||
{ | ||
return GetWorkingDays(from, to, new WorkingDayCultureInfo()); | ||
var workingDayCultureInfo = new WorkingDayCultureInfo(); | ||
|
||
return GetWorkingDays(from, to, workingDayCultureInfo); | ||
} | ||
|
||
/// <summary> | ||
|