< Summary

Information
Class: MyNet.Primitives.DateOnlyExtensions
Assembly: MyNet.Primitives
File(s): https://raw.githubusercontent.com/sandre58/MyNet/85372080fe102cd9ee155ceab49ae000e7f66103/src/MyNet.Primitives/Temporal/Extensions/DateOnlyExtensions.cs
Tag: 323_28699572109
Line coverage
76%
Covered lines: 93
Uncovered lines: 28
Coverable lines: 121
Total lines: 491
Line coverage: 76.8%
Branch coverage
76%
Covered branches: 53
Total branches: 69
Branch coverage: 76.8%
Method coverage

Feature is only available for sponsors

Upgrade to PRO version

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity Line coverage
EndOfDecade(...)100%11100%
BeginningOfDecade(...)100%11100%
NextYear(...)100%22100%
PreviousYear(...)50%2257.14%
NextDay(...)100%11100%
PreviousDay(...)100%11100%
Next(...)100%22100%
Next(...)100%44100%
Previous(...)100%22100%
Previous(...)100%44100%
WeekAfter(...)100%11100%
WeekEarlier(...)100%11100%
SetYear(...)100%11100%
SetMonth(...)100%11100%
SetDay(...)100%11100%
IsBefore(...)100%210%
IsAfter(...)100%210%
IsBefore(...)100%210%
IsAfter(...)100%210%
At(...)100%11100%
At(...)100%210%
At(...)100%11100%
At(...)100%210%
At(...)100%210%
BeginningOfDay(...)100%11100%
EndOfDay(...)100%11100%
BeginningOfQuarter(...)100%11100%
BeginningOfMonth(...)100%11100%
EndOfQuarter(...)100%210%
EndOfMonth(...)100%11100%
AddBusinessDays(...)100%88100%
SubtractBusinessDays(...)100%11100%
IsInFuture(...)100%210%
IsInPast(...)100%210%
BeginningOfWeek(...)50%44100%
BeginningOfYear(...)100%11100%
EndOfWeek(...)100%11100%
EndOfYear(...)100%11100%
IsLastDayOfWeek(...)100%210%
IsFirstDayOfWeek(...)100%210%
IsWeekend(...)75%44100%
PreviousMonth(...)100%66100%
NextMonth(...)100%66100%
IsToday(...)100%210%
SameWeek(...)0%620%
SameMonth(...)100%22100%
SameYear(...)100%11100%
SameDecade(...)100%11100%
NumberOfDays(...)100%11100%
CompareWeek(...)100%11100%
NumberOfWeeks(...)100%11100%
CompareMonth(...)100%11100%
NumberOfMonths(...)100%11100%
CompareYear(...)100%11100%
NumberOfYears(...)100%11100%
Age(...)0%4260%
Range()73.33%171578.94%

File(s)

https://raw.githubusercontent.com/sandre58/MyNet/85372080fe102cd9ee155ceab49ae000e7f66103/src/MyNet.Primitives/Temporal/Extensions/DateOnlyExtensions.cs

#LineLine coverage
 1// -----------------------------------------------------------------------
 2// <copyright file="DateOnlyExtensions.cs" company="Stéphane ANDRE">
 3// Copyright (c) Stéphane ANDRE. All rights reserved.
 4// </copyright>
 5// -----------------------------------------------------------------------
 6
 7using System;
 8using System.Collections.Generic;
 9using System.Globalization;
 10using MyNet.Primitives.Temporal;
 11
 12#pragma warning disable IDE0130 // Namespace does not match folder structure
 13namespace MyNet.Primitives;
 14#pragma warning restore IDE0130 // Namespace does not match folder structure
 15
 16public static class DateOnlyExtensions
 17{
 18    extension(DateOnly date)
 19    {
 20        /// <summary>
 21        /// Returns the last day of the decade for the provided date.
 22        /// </summary>
 323        public DateOnly EndOfDecade() => date.SetYear(date.Year - (date.Year % 10) + 9).EndOfYear();
 24
 25        /// <summary>
 26        /// Returns the first day of the decade for the provided date.
 27        /// </summary>
 1528        public DateOnly BeginningOfDecade() => date.SetYear(date.Year - (date.Year % 10)).BeginningOfYear();
 29
 30        /// <summary>
 31        /// Returns the same date (same Day, Month, Hour, Minute, Second etc.) in the next calendar year.
 32        /// If that day does not exist in next year in same month, number of missing days is added to the last day in sa
 33        /// </summary>
 34        public DateOnly NextYear()
 35        {
 636            var nextYear = date.Year + 1;
 637            var numberOfDaysInSameMonthNextYear = DateTime.DaysInMonth(nextYear, date.Month);
 38
 939            if (numberOfDaysInSameMonthNextYear >= date.Day) return new(nextYear, date.Month, date.Day);
 340            var differenceInDays = date.Day - numberOfDaysInSameMonthNextYear;
 341            var dateTime = new DateOnly(nextYear, date.Month, numberOfDaysInSameMonthNextYear);
 342            return dateTime.AddDays(differenceInDays);
 43        }
 44
 45        /// <summary>
 46        /// Returns the same date (same Day, Month, Hour, Minute, Second etc.) in the previous calendar year.
 47        /// If that day does not exist in previous year in same month, number of missing days is added to the last day i
 48        /// </summary>
 49        public DateOnly PreviousYear()
 50        {
 351            var previousYear = date.Year - 1;
 352            var numberOfDaysInSameMonthPreviousYear = DateTime.DaysInMonth(previousYear, date.Month);
 53
 354            if (numberOfDaysInSameMonthPreviousYear >= date.Day)
 355                return new(previousYear, date.Month, date.Day);
 056            var differenceInDays = date.Day - numberOfDaysInSameMonthPreviousYear;
 057            var dateTime = new DateOnly(previousYear, date.Month, numberOfDaysInSameMonthPreviousYear);
 058            return dateTime.AddDays(differenceInDays);
 59        }
 60
 61        /// <summary>
 62        /// Returns the next calendar day.
 63        /// </summary>
 64        /// <returns>The date one day after <paramref name="date"/>.</returns>
 5465        public DateOnly NextDay() => date.AddDays(1);
 66
 67        /// <summary>
 68        /// Returns the previous calendar day.
 69        /// </summary>
 70        /// <returns>The date one day before <paramref name="date"/>.</returns>
 6671        public DateOnly PreviousDay() => date.AddDays(-1);
 72
 73        /// <summary>
 74        /// Returns first next occurrence of specified <see cref="DayOfWeek"/>.
 75        /// </summary>
 76        public DateOnly Next(DayOfWeek day)
 77        {
 78            do
 79            {
 1280                date = date.NextDay();
 81            }
 1282            while (date.DayOfWeek != day);
 83
 384            return date;
 85        }
 86
 87        /// <summary>
 88        /// Returns the next occurrence of a specific day and month.
 89        /// </summary>
 90        public DateOnly Next(int day, int month)
 91        {
 92            do
 93            {
 3994                date = date.NextDay();
 95            }
 3996            while (date.Month != month || date.Day != day);
 97
 398            return date;
 99        }
 100
 101        /// <summary>
 102        /// Returns the previous occurrence of the specified <see cref="DayOfWeek"/>.
 103        /// </summary>
 104        public DateOnly Previous(DayOfWeek day)
 105        {
 106            do
 107            {
 9108                date = date.PreviousDay();
 109            }
 9110            while (date.DayOfWeek != day);
 111
 3112            return date;
 113        }
 114
 115        /// <summary>
 116        /// Returns the previous occurrence of the specified day/month.
 117        /// </summary>
 118        public DateOnly Previous(int day, int month)
 119        {
 120            do
 121            {
 54122                date = date.PreviousDay();
 123            }
 54124            while (date.Month != month || date.Day != day);
 125
 3126            return date;
 127        }
 128
 129        /// <summary>
 130        /// Increases the date by one calendar week (number of days determined by <see cref="DateTimeHelper.DaysPerWeek"
 131        /// </summary>
 3132        public DateOnly WeekAfter() => date.AddDays(DateTimeHelper.DaysPerWeek);
 133
 134        /// <summary>
 135        /// Decreases the date by one calendar week.
 136        /// </summary>
 3137        public DateOnly WeekEarlier() => date.AddDays(-DateTimeHelper.DaysPerWeek);
 138
 139        /// <summary>
 140        /// Returns <see cref="DateOnly"/> with changed year component.
 141        /// </summary>
 21142        public DateOnly SetYear(int year) => new(year, date.Month, date.Day);
 143
 144        /// <summary>
 145        /// Returns <see cref="DateOnly"/> with changed month component.
 146        /// </summary>
 3147        public DateOnly SetMonth(int month) => new(date.Year, month, date.Day);
 148
 149        /// <summary>
 150        /// Returns <see cref="DateOnly"/> with changed day component.
 151        /// </summary>
 45152        public DateOnly SetDay(int day) => new(date.Year, date.Month, day);
 153
 154        /// <summary>
 155        /// Determines whether the current date is strictly before the specified <see cref="DateTime"/> (converted to a 
 156        /// </summary>
 0157        public bool IsBefore(DateTime toCompareWith) => date.ToDateTime(TimeOnly.MinValue).IsBefore(toCompareWith);
 158
 159        /// <summary>
 160        /// Determines whether the current date is strictly after the specified <see cref="DateTime"/> (converted to a <
 161        /// </summary>
 0162        public bool IsAfter(DateTime toCompareWith) => date.ToDateTime(TimeOnly.MinValue).IsAfter(toCompareWith);
 163
 164        /// <summary>
 165        /// Determines whether the current date is strictly before the specified <see cref="DateOnly"/>.
 166        /// </summary>
 0167        public bool IsBefore(DateOnly toCompareWith) => date.IsBefore(toCompareWith.ToDateTime(TimeOnly.MinValue));
 168
 169        /// <summary>
 170        /// Determines whether the current date is strictly after the specified <see cref="DateOnly"/>.
 171        /// </summary>
 0172        public bool IsAfter(DateOnly toCompareWith) => date.IsAfter(toCompareWith.ToDateTime(TimeOnly.MinValue));
 173
 174        /// <summary>
 175        /// Returns a <see cref="DateTime"/> with the time part set to the provided <see cref="TimeOnly"/>.
 176        /// </summary>
 177        /// <param name="time">The time to apply.</param>
 178        /// <returns>A <see cref="DateTime"/> representing the combined date and time.</returns>
 12179        public DateTime At(TimeOnly time) => date.ToDateTime(time);
 180
 181        /// <summary>
 182        /// Returns a <see cref="DateTime"/> with the time part set to the provided <see cref="TimeOnly"/> and specified
 183        /// </summary>
 0184        public DateTime At(TimeOnly time, DateTimeKind kind) => date.ToDateTime(time, kind);
 185
 186        /// <summary>
 187        /// Returns a <see cref="DateTime"/> representing the provided hour and minute on the same date.
 188        /// </summary>
 3189        public DateTime At(int hour, int minute) => date.At(new(hour, minute));
 190
 191        /// <summary>
 192        /// Returns a <see cref="DateTime"/> representing the provided hour, minute and second on the same date.
 193        /// </summary>
 0194        public DateTime At(int hour, int minute, int second) => date.At(new(hour, minute, second));
 195
 196        /// <summary>
 197        /// Returns a <see cref="DateTime"/> representing the provided hour, minute, second and milliseconds on the same
 198        /// </summary>
 0199        public DateTime At(int hour, int minute, int second, int milliseconds) => date.At(new(hour, minute, second, mill
 200
 201        /// <summary>
 202        /// Gets the earliest possible <see cref="DateTime"/> for the date (midnight).
 203        /// </summary>
 3204        public DateTime BeginningOfDay() => date.At(TimeOnly.MinValue);
 205
 206        /// <summary>
 207        /// Gets the latest possible <see cref="DateTime"/> for the date (end of day).
 208        /// </summary>
 3209        public DateTime EndOfDay() => date.At(TimeOnly.MaxValue);
 210
 211        /// <summary>
 212        /// Sets the day of the <see cref="DateOnly"/> to the first day in that calendar quarter.
 213        /// credit to http://www.devcurry.com/2009/05/find-first-and-last-day-of-current.html.
 214        /// </summary>
 215        /// <returns>given <see cref="DateTime"/> with the day part set to the first day in the quarter.</returns>
 216        public DateOnly BeginningOfQuarter()
 217        {
 3218            var currentQuarter = ((date.Month - 1) / 3) + 1;
 3219            return new(date.Year, (3 * currentQuarter) - 2, 1);
 220        }
 221
 222        /// <summary>
 223        /// Sets the day of the <see cref="DateOnly"/> to the first day in that month.
 224        /// </summary>
 225        /// <returns>given <see cref="DateOnly"/> with the day part set to the first day in that month.</returns>
 3226        public DateOnly BeginningOfMonth() => date.SetDay(1);
 227
 228        /// <summary>
 229        /// Sets the day of the <see cref="DateOnly"/> to the last day in that calendar quarter.
 230        /// credit to http://www.devcurry.com/2009/05/find-first-and-last-day-of-current.html.
 231        /// </summary>
 232        /// <returns>given <see cref="DateOnly"/> with the day part set to the last day in the quarter.</returns>
 233        public DateOnly EndOfQuarter()
 234        {
 0235            var currentQuarter = ((date.Month - 1) / 3) + 1;
 0236            var firstDay = new DateOnly(date.Year, (3 * currentQuarter) - 2, 1);
 0237            return new(firstDay.Year, firstDay.Month + 2, 1);
 238        }
 239
 240        /// <summary>
 241        /// Sets the day of the <see cref="DateOnly"/> to the last day in that month.
 242        /// </summary>
 243        /// <returns>given <see cref="DateOnly"/> with the day part set to the last day in that month.</returns>
 21244        public DateOnly EndOfMonth() => date.SetDay(DateTime.DaysInMonth(date.Year, date.Month));
 245
 246        /// <summary>
 247        /// Adds the given number of business days to the <see cref="DateOnly"/>.
 248        /// </summary>
 249        /// <param name="days">Number of business days to be added.</param>
 250        /// <returns>A <see cref="DateOnly"/> increased by a given number of business days.</returns>
 251        public DateOnly AddBusinessDays(int days)
 252        {
 6253            var sign = Math.Sign(days);
 6254            var unsignedDays = Math.Abs(days);
 24255            for (var i = 0; i < unsignedDays; i++)
 256            {
 257                do
 258                {
 18259                    date = date.AddDays(sign);
 260                }
 18261                while (date.DayOfWeek is DayOfWeek.Saturday or DayOfWeek.Sunday);
 262            }
 263
 6264            return date;
 265        }
 266
 267        /// <summary>
 268        /// Subtracts the given number of business days to the <see cref="DateOnly"/>.
 269        /// </summary>
 270        /// <param name="days">Number of business days to be subtracted.</param>
 271        /// <returns>A <see cref="DateOnly"/> increased by a given number of business days.</returns>
 3272        public DateOnly SubtractBusinessDays(int days) => date.AddBusinessDays(-days);
 273
 274        /// <summary>
 275        /// Determine if a <see cref="DateOnly"/> is in the future compared to the current UTC date.
 276        /// </summary>
 277        /// <returns><c>true</c> if <paramref name="date"/> is in the future; otherwise <c>false</c>.</returns>
 0278        public bool IsInFuture() => date.At(TimeOnly.MinValue) > DateTime.UtcNow;
 279
 280        /// <summary>
 281        /// Determine if a <see cref="DateOnly"/> is in the past compared to the current UTC date.
 282        /// </summary>
 283        /// <returns><c>true</c> if <paramref name="date"/> is in the past; otherwise <c>false</c>.</returns>
 0284        public bool IsInPast() => date.At(TimeOnly.MinValue) < DateTime.UtcNow;
 285
 286        /// <summary>
 287        /// Returns a DateOnly adjusted to the beginning of the week.
 288        /// </summary>
 289        /// <returns>A DateOnly instance adjusted to the beginning of the current week.</returns>
 290        /// <remarks>the beginning of the week is controlled by the current Culture.</remarks>
 291        public DateOnly BeginningOfWeek(DayOfWeek? firstDayOfWeek = null)
 292        {
 9293            var currentCulture = CultureInfo.CurrentCulture;
 9294            var firstDay = firstDayOfWeek ?? currentCulture.DateTimeFormat.FirstDayOfWeek;
 9295            var offset = date.DayOfWeek < firstDay ? 7 : 0;
 9296            var numberOfDaysSinceBeginningOfTheWeek = date.DayOfWeek + offset - firstDay;
 297
 9298            return date.AddDays(-numberOfDaysSinceBeginningOfTheWeek);
 299        }
 300
 301        /// <summary>
 302        /// Returns the first day of the year keeping the time component intact.
 303        /// </summary>
 304        /// <returns>New date.</returns>
 18305        public DateOnly BeginningOfYear() => new(date.Year, 1, 1);
 306
 307        /// <summary>
 308        /// Returns the last day of the week keeping the time component intact.
 309        /// </summary>
 310        /// <returns>New date.</returns>
 3311        public DateOnly EndOfWeek(DayOfWeek? firstDayOfWeek = null) => date.BeginningOfWeek(firstDayOfWeek).AddDays(6);
 312
 313        /// <summary>
 314        /// Returns the last day of the year keeping the time component intact.
 315        /// </summary>
 316        /// <returns>New date.</returns>
 6317        public DateOnly EndOfYear() => new(date.Year, 12, 31);
 318
 319        /// <summary>
 320        /// Determines whether the current date is the last day of the week.
 321        /// </summary>
 0322        public bool IsLastDayOfWeek(DayOfWeek? firstDayOfWeek = null) => date.DayOfWeek == date.EndOfWeek(firstDayOfWeek
 323
 324        /// <summary>
 325        /// Determines whether the current date is the first day of the week.
 326        /// </summary>
 0327        public bool IsFirstDayOfWeek(DayOfWeek? firstDayOfWeek = null) => date.DayOfWeek == date.EndOfWeek(firstDayOfWee
 328
 329        /// <summary>
 330        /// Determines whether the current date falls on a weekend (Saturday or Sunday).
 331        /// </summary>
 6332        public bool IsWeekend() => date.DayOfWeek is DayOfWeek.Saturday or DayOfWeek.Sunday;
 333
 334        /// <summary>
 335        /// Returns the previous month keeping the time component intact.
 336        /// </summary>
 337        /// <returns>New date.</returns>
 338        public DateOnly PreviousMonth()
 339        {
 9340            var year = date.Month == 1 ? date.Year - 1 : date.Year;
 341
 9342            var month = date.Month == 1 ? 12 : date.Month - 1;
 343
 9344            var firstDayOfPreviousMonth = new DateOnly(year, month, 1);
 345
 9346            var lastDayOfPreviousMonth = firstDayOfPreviousMonth.EndOfMonth().Day;
 347
 9348            var day = date.Day > lastDayOfPreviousMonth ? lastDayOfPreviousMonth : date.Day;
 349
 9350            return firstDayOfPreviousMonth.SetDay(day);
 351        }
 352
 353        /// <summary>
 354        /// Returns the next month keeping the time component intact.
 355        /// </summary>
 356        /// <returns>New date.</returns>
 357        public DateOnly NextMonth()
 358        {
 9359            var year = date.Month == 12 ? date.Year + 1 : date.Year;
 360
 9361            var month = date.Month == 12 ? 1 : date.Month + 1;
 362
 9363            var firstDayOfNextMonth = new DateOnly(year, month, 1);
 364
 9365            var lastDayOfPreviousMonth = firstDayOfNextMonth.EndOfMonth().Day;
 366
 9367            var day = date.Day > lastDayOfPreviousMonth ? lastDayOfPreviousMonth : date.Day;
 368
 9369            return firstDayOfNextMonth.SetDay(day);
 370        }
 371
 372        /// <summary>
 373        /// Determines whether the date corresponds to today's day (UTC based).
 374        /// </summary>
 0375        public bool IsToday() => date.Day == DateTime.UtcNow.Day;
 376
 377        /// <summary>
 378        /// Determines whether the specified date falls in the same week as the current date.
 379        /// </summary>
 380        /// <param name="date1">Value to compare with.</param>
 381        /// <returns><c>true</c> if the specified date is within the same week; otherwise <c>false</c>.</returns>
 0382        public bool SameWeek(DateOnly date1) => date1.IsAfter(date.BeginningOfWeek()) && date1.IsBefore(date.EndOfWeek()
 383
 384        /// <summary>
 385        /// Determines whether the specified date is in the same month as the current date.
 386        /// </summary>
 6387        public bool SameMonth(DateOnly otherDate) => date.Month == otherDate.Month && date.Year == otherDate.Year;
 388
 389        /// <summary>
 390        /// Determines whether the specified date is in the same year as the current date.
 391        /// </summary>
 3392        public bool SameYear(DateOnly otherDate) => date.Year == otherDate.Year;
 393
 394        /// <summary>
 395        /// Determines whether the specified date is in the same decade as the current date.
 396        /// </summary>
 6397        public bool SameDecade(DateOnly otherDate) => date.BeginningOfDecade() == otherDate.BeginningOfDecade();
 398
 399        /// <summary>
 400        /// Returns the absolute number of days between two dates.
 401        /// </summary>
 6402        public int NumberOfDays(DateOnly dateTo) => Math.Abs((date.ToDateTime(TimeOnly.MinValue) - dateTo.ToDateTime(Tim
 403
 404        /// <summary>
 405        /// Returns the difference in weeks between two dates (signed integer).
 406        /// </summary>
 407        public int CompareWeek(DateOnly dateTo)
 408        {
 3409            var ts = dateTo.ToDateTime(TimeOnly.MinValue).Subtract(date.ToDateTime(TimeOnly.MinValue));
 3410            return ts.Days / 7;
 411        }
 412
 413        /// <summary>
 414        /// Returns the absolute number of weeks between two dates.
 415        /// </summary>
 3416        public int NumberOfWeeks(DateOnly dateTo) => Math.Abs(date.CompareWeek(dateTo));
 417
 418        /// <summary>
 419        /// Compare two dates and return difference of months (signed integer).
 420        /// </summary>
 9421        public int CompareMonth(DateTime dateTo) => ((dateTo.Year - date.Year) * 12) + (dateTo.Month - date.Month);
 422
 423        /// <summary>
 424        /// Returns the absolute number of months between two dates.
 425        /// </summary>
 3426        public int NumberOfMonths(DateTime dateTo) => Math.Abs(date.CompareMonth(dateTo));
 427
 428        /// <summary>
 429        /// Compare two dates and return difference of years (signed integer).
 430        /// </summary>
 3431        public int CompareYear(DateTime dateTo) => dateTo.Year - date.Year;
 432
 433        /// <summary>
 434        /// Returns the absolute number of years between two dates.
 435        /// </summary>
 3436        public int NumberOfYears(DateTime dateTo) => Math.Abs(date.CompareYear(dateTo));
 437
 438        /// <summary>
 439        /// Calculates the age in years from a birthdate to now (UTC based).
 440        /// </summary>
 441        /// <returns>The number of full years elapsed since <paramref name="date"/>.</returns>
 442        public int Age()
 443        {
 0444            var today = DateTime.UtcNow;
 445
 0446            var age = today.Year - date.Year;
 447
 0448            if (today.Month < date.Month || (today.Month == date.Month && today.Day < date.Day))
 0449                age--;
 450
 0451            return age;
 452        }
 453
 454    /// <summary>
 455    /// Generates a sequence of DateOnly values starting from a minimum value and ending at a maximum value, with a spec
 456    /// </summary>
 457    /// <param name="max">The maximum value of the range.</param>
 458    /// <param name="step">The step value for each iteration.</param>
 459    /// <param name="unit">The time unit for the step.</param>
 460    /// <returns>A sequence of DateOnly values within the specified range.</returns>
 461    public IEnumerable<DateOnly> Range(DateOnly max, int step = 1, TimeUnit unit = TimeUnit.Day)
 462    {
 21463        ArgumentOutOfRangeException.ThrowIfZero(step);
 464
 18465        Func<DateOnly, DateOnly> increment = unit switch
 18466        {
 6467            TimeUnit.Day => x => x.AddDays(step),
 3468            TimeUnit.Week => x => x.AddDays(step * 7),
 3469            TimeUnit.Month => x => x.AddMonths(step),
 3470            TimeUnit.Year => x => x.AddYears(step),
 0471            TimeUnit.Millisecond => throw new InvalidOperationException(),
 0472            TimeUnit.Second => throw new InvalidOperationException(),
 0473            TimeUnit.Minute => throw new InvalidOperationException(),
 3474            TimeUnit.Hour => throw new InvalidOperationException(),
 0475            _ => x => x.AddDays(step)
 18476        };
 477
 15478        if (step > 0)
 479        {
 132480            for (var i = date; i <= max; i = increment(i))
 54481                yield return i;
 482        }
 483        else
 484        {
 36485            for (var i = date; i >= max; i = increment(i))
 15486                yield return i;
 487        }
 15488    }
 489    }
 490}
 491

Methods/Properties

EndOfDecade(System.DateOnly)
BeginningOfDecade(System.DateOnly)
NextYear(System.DateOnly)
PreviousYear(System.DateOnly)
NextDay(System.DateOnly)
PreviousDay(System.DateOnly)
Next(System.DateOnly,System.DayOfWeek)
Next(System.DateOnly,System.Int32,System.Int32)
Previous(System.DateOnly,System.DayOfWeek)
Previous(System.DateOnly,System.Int32,System.Int32)
WeekAfter(System.DateOnly)
WeekEarlier(System.DateOnly)
SetYear(System.DateOnly,System.Int32)
SetMonth(System.DateOnly,System.Int32)
SetDay(System.DateOnly,System.Int32)
IsBefore(System.DateOnly,System.DateTime)
IsAfter(System.DateOnly,System.DateTime)
IsBefore(System.DateOnly,System.DateOnly)
IsAfter(System.DateOnly,System.DateOnly)
At(System.DateOnly,System.TimeOnly)
At(System.DateOnly,System.TimeOnly,System.DateTimeKind)
At(System.DateOnly,System.Int32,System.Int32)
At(System.DateOnly,System.Int32,System.Int32,System.Int32)
At(System.DateOnly,System.Int32,System.Int32,System.Int32,System.Int32)
BeginningOfDay(System.DateOnly)
EndOfDay(System.DateOnly)
BeginningOfQuarter(System.DateOnly)
BeginningOfMonth(System.DateOnly)
EndOfQuarter(System.DateOnly)
EndOfMonth(System.DateOnly)
AddBusinessDays(System.DateOnly,System.Int32)
SubtractBusinessDays(System.DateOnly,System.Int32)
IsInFuture(System.DateOnly)
IsInPast(System.DateOnly)
BeginningOfWeek(System.DateOnly,System.Nullable`1<System.DayOfWeek>)
BeginningOfYear(System.DateOnly)
EndOfWeek(System.DateOnly,System.Nullable`1<System.DayOfWeek>)
EndOfYear(System.DateOnly)
IsLastDayOfWeek(System.DateOnly,System.Nullable`1<System.DayOfWeek>)
IsFirstDayOfWeek(System.DateOnly,System.Nullable`1<System.DayOfWeek>)
IsWeekend(System.DateOnly)
PreviousMonth(System.DateOnly)
NextMonth(System.DateOnly)
IsToday(System.DateOnly)
SameWeek(System.DateOnly,System.DateOnly)
SameMonth(System.DateOnly,System.DateOnly)
SameYear(System.DateOnly,System.DateOnly)
SameDecade(System.DateOnly,System.DateOnly)
NumberOfDays(System.DateOnly,System.DateOnly)
CompareWeek(System.DateOnly,System.DateOnly)
NumberOfWeeks(System.DateOnly,System.DateOnly)
CompareMonth(System.DateOnly,System.DateTime)
NumberOfMonths(System.DateOnly,System.DateTime)
CompareYear(System.DateOnly,System.DateTime)
NumberOfYears(System.DateOnly,System.DateTime)
Age(System.DateOnly)
Range()