Table of Contents

Class DateOnlyExtensions

Namespace
Plugin.BaseTypeExtensions
Assembly
Plugin.BaseTypeExtensions.dll

Provides extension methods for DateOnly operations, such as range checks and percentage calculations.

public static class DateOnlyExtensions
Inheritance
DateOnlyExtensions
Inherited Members

Methods

DateOnlyToPercentage(DateOnly, DateOnly, DateOnly)

Converts a DateOnly value within a specified range to a percentage (0.0 to 1.0).

public static double DateOnlyToPercentage(this DateOnly value, DateOnly minBound, DateOnly maxBound)

Parameters

value DateOnly

The DateOnly value to convert

minBound DateOnly

The minimum bound of the source range

maxBound DateOnly

The maximum bound of the source range

Returns

double

The percentage representation (0.0 to 1.0)

Exceptions

ArgumentOutOfRangeException

Thrown when minBound is greater than maxBound

PercentageToDateOnly(double, DateOnly, DateOnly)

Converts a percentage (0.0 to 1.0) to a DateOnly value within the specified range.

public static DateOnly PercentageToDateOnly(this double percentage, DateOnly minBound, DateOnly maxBound)

Parameters

percentage double

The percentage value (0.0 to 1.0)

minBound DateOnly

The minimum bound of the target range

maxBound DateOnly

The maximum bound of the target range

Returns

DateOnly

The calculated DateOnly value within the specified range

Exceptions

ArgumentOutOfRangeException

Thrown when minBound is greater than maxBound