From 4c30c8228bc64216f07c211ae5f824f59b4b8503 Mon Sep 17 00:00:00 2001 From: Oliver Booth Date: Sun, 19 Apr 2020 14:14:59 +0100 Subject: [PATCH] =?UTF-8?q?=F0=9F=93=95=20Document=20return=20values=20in?= =?UTF-8?q?=20DateTimeExtensions?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- X10D/src/DateTimeExtensions.cs | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/X10D/src/DateTimeExtensions.cs b/X10D/src/DateTimeExtensions.cs index 4577b8b..d06bff8 100644 --- a/X10D/src/DateTimeExtensions.cs +++ b/X10D/src/DateTimeExtensions.cs @@ -22,7 +22,8 @@ /// /// The date from which to start. /// The date at which to stop counting. - /// Returns the number of years since as of . + /// Returns the integer number of years since as of + /// . public static int Age(this DateTime date, DateTime asOf) { return (int)(((asOf.Date - TimeSpan.FromDays(1) - date.Date).TotalDays + 1) / 365.2425); @@ -31,9 +32,9 @@ /// /// Gets a DateTime representing the first occurence of a specified day in the current month. /// - /// The current day - /// The current day of week - /// Returns a date which representing the first occurence of . + /// The current day. + /// The current day of week. + /// Returns a date representing the first occurence of . public static DateTime First(this DateTime current, DayOfWeek dayOfWeek) { DateTime first = current.FirstDayOfMonth(); @@ -50,6 +51,7 @@ /// Gets a representing the first day in the current month. /// /// The current date. + /// Returns a date representing the first day of the month>. public static DateTime FirstDayOfMonth(this DateTime current) { return current.AddDays(1 - current.Day); @@ -59,6 +61,7 @@ /// Gets a representing the last day in the current month. /// /// The current date. + /// Returns a date representing the last day of the month>. public static DateTime LastDayOfMonth(this DateTime current) { var daysInMonth = DateTime.DaysInMonth(current.Year, current.Month); @@ -70,6 +73,7 @@ /// /// The current date. /// The current day of week. + /// Returns a date representing the final occurence of . public static DateTime Last(this DateTime current, DayOfWeek dayOfWeek) { DateTime last = current.LastDayOfMonth(); @@ -87,6 +91,7 @@ /// /// The current date. /// The day of week for the next date to get. + /// Returns a date representing the next occurence of . public static DateTime Next(this DateTime current, DayOfWeek dayOfWeek) { var offsetDays = dayOfWeek - current.DayOfWeek;