Ir al contenido principal

Referencia de paquetes

Vali-Tempo se distribuye como 10 paquetes NuGet independientes. Instala solo los módulos que necesites, o usa Vali-Tempo para obtenerlos todos.

Todos los paquetes

PaqueteVersiónDescripciónMarcos de destino
Vali-TimeÚltimaConversiones de unidades de tiempo + ValiDatenet6.0, net7.0, net8.0, net9.0
Vali-RangeÚltimaOperaciones con rangos de fechasnet6.0, net7.0, net8.0, net9.0
Vali-CalendarÚltimaCalendario laboralnet6.0, net7.0, net8.0, net9.0
Vali-DurationÚltimaStruct Duration decimalnet6.0, net7.0, net8.0, net9.0
Vali-CountDownÚltimaCuenta regresiva y seguimiento de plazosnet6.0, net7.0, net8.0, net9.0
Vali-AgeÚltimaCálculo de edadnet6.0, net7.0, net8.0, net9.0
Vali-ScheduleÚltimaConstructor de horarios recurrentesnet6.0, net7.0, net8.0, net9.0
Vali-HolidayÚltimaDatos de feriados para más de 35 paísesnet6.0, net7.0, net8.0, net9.0
Vali-TimeZoneÚltimaConversión de zonas horarias IANAnet6.0, net7.0, net8.0, net9.0
Vali-TempoÚltimaMeta-paquete (todos los módulos)net6.0, net7.0, net8.0, net9.0

Vali-Time

NuGet: nuget.org/packages/Vali-Time

dotnet add package Vali-Time

Proporciona:

  • IValiTime — Convert, SumTimes, SubtractTimes, FormatTime, GetBestUnit, ParseTime, Breakdown, ToTimeSpan, FromTimeSpan, Clamp, Compare, MultiConvert
  • IValiDate — Diff, Add, Subtract, StartOf, EndOf, IsBefore, IsAfter, IsSameDay, IsSamePeriod, IsWeekend, IsWeekday, IsLeapYear, DaysInMonth, WeekOfYear, WeekYear, DayOfYear, ProgressInYear, ProgressInMonth
  • IValiDateQuarter — QuarterOf, QuarterStart, QuarterEnd, QuarterNameFull, DaysInQuarter, ProgressInQuarter, NextQuarterStart, TryNextQuarterStart, TryPreviousQuarterStart, etc.
  • Enumeraciones: TimeUnit, DatePart, WeekStart

Registro: services.AddValiTime()


Vali-Range

NuGet: nuget.org/packages/Vali-Range

dotnet add package Vali-Range

Proporciona:

  • IValiRange — Create, LastUnits, NextUnits, ThisMonth/ThisWeek/ThisQuarter/ThisYear, Contains, Overlaps, IsContainedBy, Intersection, Union, Expand, Shrink, Shift, IsAdjacent, Merge, Gaps(ranges, container), EachDay/EachWeek/EachMonth, EachWorkday, SplitByDay/Week/Month/Quarter
  • Struct DateRange — Start, End, Duration, TotalDays, IsEmpty

Registro: services.AddValiRange()


Vali-Calendar

NuGet: nuget.org/packages/Vali-Calendar

dotnet add package Vali-Calendar

Proporciona:

  • IValiCalendar — WeekOf, CurrentWeek, WeeksInMonth, WeekCountInMonth, IsFirstDayOfMonth, IsLastDayOfMonth, DaysInMonth, DaysOfMonth, IsWorkday, WorkdaysBetween, AddWorkdays, WorkdaysInMonth, WorkdaysInYear, NextWorkday, PreviousWorkday, HasHolidayProvider, HolidaysInMonth, HolidaysInYear, IsLeapYear, DaysInYear
  • Struct CalendarWeek — Year, WeekNumber, Start, End, Days

Registro: services.AddValiCalendar()


Vali-Duration

NuGet: nuget.org/packages/Vali-Duration

dotnet add package Vali-Duration

Proporciona:

  • Struct ValiDuration — FromMilliseconds hasta FromYears, FromTimeSpan, Zero; TotalMilliseconds hasta TotalDays; As, Format, ToTimeSpan; operadores aritméticos (+, -, *, /); operadores de comparación; conversiones implícitas hacia/desde TimeSpan

Nota: ValiDuration es un tipo de valor autónomo — no requiere registro en DI.


Vali-CountDown

NuGet: nuget.org/packages/Vali-CountDown

dotnet add package Vali-CountDown

Proporciona:

  • IValiCountDown — IsExpired, TimeUntil, TimeElapsed, Progress, ProgressPercent, Breakdown, Format, IsWithin, IsStarted(from) — devuelve true si el instante de inicio está en el pasado o presente

Registro: services.AddValiCountDown()


Vali-Age

NuGet: nuget.org/packages/Vali-Age

dotnet add package Vali-Age

Proporciona:

  • IValiAge — Years, Exact, Format, Relative, IsAtLeast, IsBirthday, NextBirthday, PreviousBirthday, DaysUntilBirthday
  • Struct AgeResult — Years, Months, Days, TotalDays, Birthdate
  • Convención de año bisiesto para el 29 de febrero manejada automáticamente

Registro: services.AddValiAge()


Vali-Schedule

NuGet: nuget.org/packages/Vali-Schedule

dotnet add package Vali-Schedule

Proporciona:

  • Constructor fluido IValiSchedule — Every, On, At, StartingFrom, EndsAfter, EndsOn, OnDayOfMonth, WithCustomPredicate, Build
  • Objeto de consulta Schedule — NextOccurrence, PreviousOccurrence, OccursOn, Occurrences, OccurrencesInRange
  • Enumeraciones: RecurrenceType (Daily, Weekly, Monthly, Yearly), RecurrenceEnd (Never, AfterOccurrences, OnDate)

Registro: services.AddValiSchedule() — registrar como Transient o Scoped (no como Singleton)


Vali-Holiday

NuGet: nuget.org/packages/Vali-Holiday

dotnet add package Vali-Holiday

Proporciona:

  • IValiHoliday — Register, For, Supports, SupportedCountries, IsHoliday, GetHolidays, GetNextHolidayWithYear, GetPreviousHolidayWithYear, IsLongWeekend, HolidaysThisMonth(year, month, countryCode)
    • Obsoleto: GetNextHoliday y GetPreviousHoliday — usa las variantes WithYear (GetNextHolidayWithYear / GetPreviousHolidayWithYear)
  • Clase HolidayInfo — Name, LocalName, Date, Country, Type, IsObserved, IsFixed
  • Enumeración HolidayType — Public, Bank, School, Optional, Observance
  • Interfaz IHolidayProvider — implementa para calendarios de feriados personalizados
  • HolidayProviderFactory — CreateAll (más de 35 países), CreateLatinAmerica (15), CreateEurope (22), CreateOther (7)
  • EasterCalculator — método estático GetEaster(year)

Registro: services.AddValiHoliday()


Vali-TimeZone

NuGet: nuget.org/packages/Vali-TimeZone

dotnet add package Vali-TimeZone

Proporciona:

  • IValiTimeZone — Convert, ConvertOffset, ToUtc, FromUtc, ToDateTimeOffset, GetOffset, GetBaseOffset, IsDst, OffsetDiff, FindZone, AllZones, ZonesForCountry, IsValidZone, Now, Today, IsSameInstant, FormatWithZone
  • Clase ValiZoneInfo — Id, DisplayName, Country, StandardOffset, CurrentOffset, SupportsDst, BaseUtcOffset
  • Más de 45 zonas horarias IANA seleccionadas

Registro: services.AddValiTimeZone()


Vali-Tempo (meta-paquete)

NuGet: nuget.org/packages/Vali-Tempo

dotnet add package Vali-Tempo

El meta-paquete depende de los 9 módulos anteriores. Proporciona un único método de extensión que registra todos los servicios:

// Program.cs
builder.Services.AddValiTempo();

// Registra como singletons:
// IValiTime, IValiDate, IValiDateQuarter
// IValiRange
// IValiCalendar
// IValiCountDown
// IValiAge
// IValiSchedule
// IValiHoliday
// IValiTimeZone

Dependencias: Vali-Time, Vali-Range, Vali-Calendar, Vali-Duration, Vali-CountDown, Vali-Age, Vali-Schedule, Vali-Holiday, Vali-TimeZone


Mapa de dependencias

Vali-Tempo
├── Vali-Time
├── Vali-Range (referencia Vali-Time para TimeUnit)
├── Vali-Calendar (opcional: referencia Vali-Holiday para días laborables con feriados)
├── Vali-Duration
├── Vali-CountDown (referencia Vali-Duration)
├── Vali-Age
├── Vali-Schedule (referencia Vali-Range para OccurrencesInRange)
├── Vali-Holiday
└── Vali-TimeZone

Todos los paquetes tienen como destino múltiple net6.0, net7.0, net8.0 y net9.0.