You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[TestMethod]
public void TestTimeBetweenDatesRemovingHolidaysAndWeekends()
{
// Arrange
var start = new DateTime(2017, 12, 22, 12, 00, 00);
var end = new DateTime(2017, 12, 27, 12, 00, 00);
// Act
var result = new SwedenPublicHoliday().TimeBetweenDatesWithoutHolidaysAndWeekends(start, end);
// Assert
Assert.AreEqual(new TimeSpan(24, 0, 0), result);
}
The text was updated successfully, but these errors were encountered:
We already use the term "WorkingDay" (in NextWorkingDay, PreviousWorkingDay).
In English, this usually means Monday-Friday, excluding weekends and holidays.
Of course there are businesses that work on Saturdays, and some on Sundays and holidays, but the conventional meaning excludes weekends. In German, Werktag legally means Monday-Saturday, but conventionally Saturdays are excluded.
So... I suggest holidays.WorkingDaysBetween(start, end);
Also I'd suggest returning an int, not a TimeSpan, as we only care about days, and spans over daylight savings time changes would be confusing.
I think i wanted a feature in your library that is not ment to be in your library. I solved what i wanted to accomplish with the help of your library. And that was to get elapsed time between two dates only counting time during workingdays(Mon-Fri) excluding holidays accuring on mon-fri. Thanks for a good library.
Example test.
The text was updated successfully, but these errors were encountered: