Date | 2021-10-30 (1,120 days ago) |
---|---|
Downloads | 34K downloads |
NuGet | View on NuGet |
GitHub | View on GitHub |
Target Frameworks | .NET Standard 1.1 .NET Standard 1.3 .NET Standard 2.0 .NET 4.5 .NET 4.6 .NET 4.7 .NET 4.8 |
#installation
">Installation#changelog
">ChangelogFixed issue with EssentialsDate.IsWeekend
calling the wrong utility method (see 1ac081d
)
This is the same as the issue reported in #16
, but in a different, but similar part of the code.
Added new IsTomorrow
and IsYesterday
properties to the EssentialsDate
class (see aa23c9a
)
The EssentialsTime
class already has similar properties, so makes sense to add matching properties for the EssentialsDate
class.
Introduced new ToHtmlString
extension method (see ee365ec
)
This release adds a ToHtmlString
extension method which can be used for turning a string
into an IHtmlString
, which is in particular useful for method chaining.
Added missing this
keyword for string extension methods (see 7656d6b
)
As the affected method has always been intended as being extension methods, it's a bug that they were missing the this
keyword.
Added logic for converting a NameValueCollection
to an URL encoded string and back again (see 41b9338
)
The StringUtils
class now contains a static ToUrlEncocedString
utility method for converting NameValueCollection
instances to an URL encoded string.
In a similar way, the StringExtensions
class now contains a ToUrlEncodedString
extension method for converting to an URL encoded string, and a ToNameValueCollection
extension method for converting an URL encoded string back to a NameValueCollection
instance.
Introduced new StringJsonConverter
and NameValueCollectionJsonConverter
classes (see c7fb51e
)
The new StringJsonConverter
class replaces the ToStringJsonConverter
class, and serializes any .NET type to it's corresponding string representation. For NameValueCollection
, this means an URL encoded string, but for any other types, the value will be the same as calling the ToString
method with an invariant culture. Generally the converter doesn't support deserialization, as most types can't be converted from a string to an object. But specifically, the converter currently supports deserializing to back to a NameValueCollection
instance or any enum type.
The NameValueCollectionJsonConverter
class serializes a NameValueCollection
to a corresponding JObject
, where each key value pair in the value collection is added as properties and in the resulting JObject
. The converter also supports deserializing a JObject
back to a corresponding NameValueCollection
.
Introduced new Truncate
utility and extension methods (see 509c92e
)
The methods allows truncating a given string to a maximum length. This is possible either via the static StringUtils.Truncate
utility method, or the StringExtensions.Truncate
extension method.
Added MinValue
and MaxValue
fields to the EssentialsDate
class (see ab27666
)
Similar to DateTime.MinValue
and DateTime.MaxValue
, the EssentialsDate
now contains a EssentialsDate.MinValue
field and a EssentialsDate.MaxValue
field respectively. This can be useful when comparing instance of EssentialsDate
.
Introduced new GuidUtils
and GuidExtensions
classes (see 990a7d6
and #17
)
The two classes contains various logic for working with GUIDs, either as static utility methods or as extension methods. This includes methods for converting GUIDs back and forth between their numeric representations, as as well as extension methods for validating GUIDs.
Added constructor overload to the EssentialsPartialDate
class (see 1cdea40
and #14
)
The new constructor takes an instance of EssentialsTime
as it's only parameter.