Working Days Calculator is a .NET library that calculates the number of working days between two different date and time points. It is customized for calculating Iranian working days.
Use the package manager Nuget to install WorkingDaysCalculator.
dotnet add package WorkingDaysCalculator
using WorkDaysCalculator;
var from = new DateTime(2024, 06, 01);
var to = DateTime.Now;
var count = new Calculator().GetWorkDaysCount(from, to, HolidayRegion.SolarHijri, HolidayRegion.LunarHijri);
var fromSolarHijri = "1403/01/01";
var toSolarHijri = to.ToPersianDate(DateFormat.yyyy_MM_dd);
var countSolarHijri = calculator.GetWorkDaysCount(fromSolarHijri, toSolarHijri, HolidayRegion.SolarHijri, HolidayRegion.LunarHijri);
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.
Please make sure to update tests as appropriate.