Skip to content

v1.1.46

Compare
Choose a tag to compare
@abjerner abjerner released this 23 Jan 19:53
· 72 commits to v1/main since this release

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 to HasValue out parameter (see 79fedd9)
    The out parameter of the StringExtensions.HasValue method is known to be not null when the method returns true, 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 a TimeZoneInfo parameter as it's second parameter, we also need to set that time zone on the created EssentialsTime instance.

  • Added To{Type} methods to the EssentialsTime class (see dc512ef)
    The new methods allow converting to EssentialsDate, EssentialsWeek, EssentialsMonth and EssentialsYear respectively. The four types already have constructors for create a new instance from an EssentialsTime 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 the EssentialsMonth class (see b926f20)
    The new EssentialsMonth.Current property allows getting a reference to the current month.

  • Added IsCurrent property to the EssentialsMonth class (see e431ff7)
    The new property returns whether a EssentialsMonth 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 either DateTime, DateTimeOffset or EssentialsDate.

EssentialsWeek

  • Added IsCurrent property to the EssentialsWeek class (see 9b806f0)
    The property returns whether an EssentialsWeek instance equals the current ISO 8601 week.

EssentialsYear

  • Added static Current property to the EssentialsYear class (see 9ff4b84)
    The property allows getting a reference to an EssentialsYear instance representing the current year.

  • Added IsCurrent property to the EssentialsYear class (see fdb52e9)
    The property returns whether an EssentialsYear instance equals the current year.

  • Additional constructors to the EssentialsYear class (see 7e880de)
    The two new constructors allow creating a new EssentialsYear instance from an EssentialsDate instance.

TimeUtils

  • Added additional utility methods for working with DateTime (see 433548f)
    The new methods allow similar functionality as already available for DateTimeOffset 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 of EssentialsDate.

Other

  • Misc improvements to the EssentialsWeekRange class (see 0add3b3)
    Mainly the EssentialsWeekRange class now implements the IReadOnlyList<EssentialsWeek> rather than IEnumerable<EssentialsWeek>.

  • Introduced the EssentialsMonthRange class (see f55300d)
    The new EssentialsMonthRange allows representing a range of months in either ascending or descending order.