JhM.BusinessDays.Col 1.0.0

dotnet add package JhM.BusinessDays.Col --version 1.0.0
                    
NuGet\Install-Package JhM.BusinessDays.Col -Version 1.0.0
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="JhM.BusinessDays.Col" Version="1.0.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="JhM.BusinessDays.Col" Version="1.0.0" />
                    
Directory.Packages.props
<PackageReference Include="JhM.BusinessDays.Col" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add JhM.BusinessDays.Col --version 1.0.0
                    
#r "nuget: JhM.BusinessDays.Col, 1.0.0"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package JhM.BusinessDays.Col@1.0.0
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=JhM.BusinessDays.Col&version=1.0.0
                    
Install as a Cake Addin
#tool nuget:?package=JhM.BusinessDays.Col&version=1.0.0
                    
Install as a Cake Tool

BusinessDaysCol

BusinessDaysCol is a .NET class library for calculating business days in Colombia, considering local holidays and weekends. It provides easy integration with dependency injection and supports custom configurations for workdays.

Features

  • Calculate business days for a given year, month, or date range in Colombia
  • Considers Colombian holidays and weekends
  • Optionally treat Saturdays and Sundays as workdays
  • Easy integration with .NET Dependency Injection
  • Constants for month and day names in English and Spanish

Installation

Add the library to your .NET project:

dotnet add package JhM.BusinessDays.Col

Or reference the project directly if using the source code.

Runtime Support

  • .NET 8.0 or higher

Registration

Register the service in your Startup.cs or Program configuration:

using JhM.BusinessDays.Col.Extensions;

// In your service configuration
services.AddBussinessDaysCol();

Then inject and use IBussinessDaysColService in your classes.

Usage Examples

using JhM.BusinessDays.Col.Abstractions;

public class MyService
{
	private readonly IBussinessDaysColService _businessDaysService;

	public MyService(IBussinessDaysColService businessDaysService)
	{
		_businessDaysService = businessDaysService;
	}

	public void PrintBusinessDays()
	{
		var days = _businessDaysService.GetBussinessDays(2026);
		foreach (var day in days)
		{
			Console.WriteLine(day);
		}
	}
}

Get business days for a specific month:

var days = _businessDaysService.GetBussinessDays(2026, 4); // April 2026

Get business days between two dates:

var days = _businessDaysService.GetBussinessDays(new DateOnly(2026, 4, 1), new DateOnly(2026, 4, 30));

Holidays examples:

Check if a specific date is a holiday in Colombia:

bool isHoliday = _businessDaysService.IsHoliday(new DateOnly(2026, 3, 24)); // Returns true if March 24, 2026 is a holiday

Business days in a month with a holiday (e.g., excluding March 24, 2026 if it's a holiday):

var marchDays = _businessDaysService.GetBussinessDays(2026, 3); // marchDays will not include 2026-03-24 if it's a holiday

License

This project is licensed under the MIT License. See the LICENSE file for details.


Sección en Español

Resumen

BusinessDaysCol es una biblioteca de clases .NET para calcular días hábiles en Colombia, considerando festivos nacionales y fines de semana. Permite integración sencilla con inyección de dependencias y configuración personalizada de días laborables.

Características

  • Calcula días hábiles para un año, mes o rango de fechas en Colombia
  • Considera festivos y fines de semana colombianos
  • Permite tratar sábados y domingos como días laborables
  • Integración fácil con Dependency Injection de .NET
  • Constantes de nombres de meses y días en inglés y español

Instalación

Agrega la biblioteca a tu proyecto .NET:

dotnet add package JhM.BusinessDays.Col

O referencia el proyecto directamente si usas el código fuente.

Soporte de Ejecución

  • .NET 8.0 o superior

Registro

Registra el servicio en tu configuración de servicios:

using JhM.BusinessDays.Col.Extensions;

// En la configuración de servicios
services.AddBussinessDaysCol();

Luego inyecta y usa IBussinessDaysColService en tus clases.

Ejemplos de uso

using JhM.BusinessDays.Col.Abstractions;

public class MiServicio
{
	private readonly IBussinessDaysColService _servicioDiasHabiles;

	public MiServicio(IBussinessDaysColService servicioDiasHabiles)
	{
		_servicioDiasHabiles = servicioDiasHabiles;
	}

	public void ImprimirDiasHabiles()
	{
		var dias = _servicioDiasHabiles.GetBussinessDays(2026);
		foreach (var dia in dias)
		{
			Console.WriteLine(dia);
		}
	}
}

Obtener días hábiles para un mes específico:

var dias = _servicioDiasHabiles.GetBussinessDays(2026, 4); // Abril 2026

Obtener días hábiles entre dos fechas:

var dias = _servicioDiasHabiles.GetBussinessDays(new DateOnly(2026, 4, 1), new DateOnly(2026, 4, 30));

Ejemplos de festivos:

Verificar si una fecha específica es festivo en Colombia:

bool esFestivo = _servicioDiasHabiles.IsHoliday(new DateOnly(2026, 3, 24)); // Devuelve true si el 24 de marzo de 2026 es festivo

Días hábiles en un mes con festivo (por ejemplo, excluyendo el 24 de marzo de 2026 si es festivo):

var diasMarzo = _servicioDiasHabiles.GetBussinessDays(2026, 3); // 'diasMarzo' no incluirá el 2026-03-24 si es festivo

Licencia

Este proyecto está bajo la Licencia MIT. Consulta el archivo LICENSE para más detalles.

Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.0.0 114 4/28/2026

Initial version