Skip to content

Commit

Permalink
feat: add new extension method for DateOnly
Browse files Browse the repository at this point in the history
  • Loading branch information
Stéphane ANDRE (E104915) committed Sep 2, 2024
1 parent e86eaa9 commit fb3a8c2
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/MyNet.Utilities/Extensions/DateOnlyExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,14 @@ public static DateOnly Previous(this DateOnly start, int day, int month)
/// <returns><see cref="DateTime"/> with hour and minute set to given values.</returns>
public static DateTime At(this DateOnly current, TimeOnly time) => current.ToDateTime(time);

/// <summary>
/// Returns the given <see cref="DateTime"/> with hour and minutes set At given values.
/// </summary>
/// <param name="current">The current <see cref="DateTime"/> to be changed.</param>
/// <param name="time">The hour to set time to.</param>
/// <returns><see cref="DateTime"/> with hour and minute set to given values.</returns>
public static DateTime At(this DateOnly current, TimeOnly time, DateTimeKind kind) => current.ToDateTime(time, kind);

Check warning on line 205 in src/MyNet.Utilities/Extensions/DateOnlyExtensions.cs

View workflow job for this annotation

GitHub Actions / build-and-tests / Build all projects

Parameter 'kind' has no matching param tag in the XML comment for 'DateOnlyExtensions.At(DateOnly, TimeOnly, DateTimeKind)' (but other parameters do)

Check warning on line 205 in src/MyNet.Utilities/Extensions/DateOnlyExtensions.cs

View workflow job for this annotation

GitHub Actions / build-and-tests / Build all projects

Parameter 'kind' has no matching param tag in the XML comment for 'DateOnlyExtensions.At(DateOnly, TimeOnly, DateTimeKind)' (but other parameters do)

Check warning on line 205 in src/MyNet.Utilities/Extensions/DateOnlyExtensions.cs

View workflow job for this annotation

GitHub Actions / build / Build

Parameter 'kind' has no matching param tag in the XML comment for 'DateOnlyExtensions.At(DateOnly, TimeOnly, DateTimeKind)' (but other parameters do)

Check warning on line 205 in src/MyNet.Utilities/Extensions/DateOnlyExtensions.cs

View workflow job for this annotation

GitHub Actions / build / Build

Parameter 'kind' has no matching param tag in the XML comment for 'DateOnlyExtensions.At(DateOnly, TimeOnly, DateTimeKind)' (but other parameters do)

/// <summary>
/// Returns the given <see cref="DateTime"/> with hour and minutes set At given values.
/// </summary>
Expand Down

0 comments on commit fb3a8c2

Please sign in to comment.