v1.1.46
Installation
Install via NuGet - either via the .NET CLI:
dotnet add package Skybrud.Essentials --version 1.1.46
or the NuGet package manager:
Install-Package Skybrud.Essentials -Version 1.1.46
Changelog
This release fixed a few minor bugs, but mainly adds additional functionality for working with date and time.
StringExtensions
- Added
[NotNullWhen(true)]
attribute toHasValue
out parameter (see 79fedd9)
The out parameter of theStringExtensions.HasValue
method is known to be not null when the method returnstrue
, so the API contract should reflect that.
EssentialsTime
-
Fixed issue with time zone not being set via
EssentialsTime
constructor (see d57979b)
Since the constructor takes aTimeZoneInfo
parameter as it's second parameter, we also need to set that time zone on the createdEssentialsTime
instance. -
Added
To{Type}
methods to theEssentialsTime
class (see dc512ef)
The new methods allow converting toEssentialsDate
,EssentialsWeek
,EssentialsMonth
andEssentialsYear
respectively. The four types already have constructors for create a new instance from anEssentialsTime
instance. The new method does the same, but may be more useful in some scenarios - eg. when using method chaining.
EssentialsMonth
-
Added static
Current
property to theEssentialsMonth
class (see b926f20)
The newEssentialsMonth.Current
property allows getting a reference to the current month. -
Added
IsCurrent
property to theEssentialsMonth
class (see e431ff7)
The new property returns whether aEssentialsMonth
instance represents the current month. -
Added new constructors to the
EssentialsMonth
class (see d1820c9)
As an alternative to the existing constructors, the new constructors allow creating new instances based on eitherDateTime
,DateTimeOffset
orEssentialsDate
.
EssentialsWeek
- Added
IsCurrent
property to theEssentialsWeek
class (see 9b806f0)
The property returns whether anEssentialsWeek
instance equals the current ISO 8601 week.
EssentialsYear
-
Added static
Current
property to theEssentialsYear
class (see 9ff4b84)
The property allows getting a reference to anEssentialsYear
instance representing the current year. -
Added
IsCurrent
property to theEssentialsYear
class (see fdb52e9)
The property returns whether anEssentialsYear
instance equals the current year. -
Additional constructors to the
EssentialsYear
class (see 7e880de)
The two new constructors allow creating a newEssentialsYear
instance from anEssentialsDate
instance.
TimeUtils
- Added additional utility methods for working with
DateTime
(see 433548f)
The new methods allow similar functionality as already available forDateTimeOffset
and other classes.
EssentialsDateUtils
- Introduced new
EssentialsDateUtils
class (see 0c7e76b)
The new class provides a number of static utility methods for various date and time operations where the return value is an instance ofEssentialsDate
.
Other
-
Misc improvements to the
EssentialsWeekRange
class (see 0add3b3)
Mainly theEssentialsWeekRange
class now implements theIReadOnlyList<EssentialsWeek>
rather thanIEnumerable<EssentialsWeek>
. -
Introduced the
EssentialsMonthRange
class (see f55300d)
The newEssentialsMonthRange
allows representing a range of months in either ascending or descending order.