Skip to content

Commit

Permalink
Added "IsCurrent" property to the "EssentialsYear" class
Browse files Browse the repository at this point in the history
The property returns whether an "EssentialsYear" instance equals the current year.
  • Loading branch information
abjerner committed Jan 22, 2023
1 parent 9ff4b84 commit fdb52e9
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/Skybrud.Essentials/Time/EssentialsYear.cs
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,11 @@ public class EssentialsYear : EssentialsPeriod, IComparable, IComparable<Essenti
protected set => base.End = value;
}

/// <summary>
/// Gets whether the year matches the current year.
/// </summary>
public bool IsCurrent => Year == DateTime.Now.Year;

#region Calendar dates

/// <summary>
Expand Down

0 comments on commit fdb52e9

Please sign in to comment.