nvdsar / WorkDaysCalculator

0 stars 0 forks source link

Working Days Calculator

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.

Installation

Use the package manager Nuget to install WorkingDaysCalculator.

dotnet add package WorkingDaysCalculator

Usage

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);

Contributing

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.

License

MIT