EstecheAssemblies 1.0.6

Good functionalities, such as:
FriendlyTimeSpan: Transforming the TimeSpan of the difference between an x DateTime and now into a friendly text. E.g. "00:00:04" = "4 minutes ago" or “00:05:32” = “5 hours ago”. (So far it is available in English, Chinese, Spanish and Swedish.)
Futhermore is including: IsDateTime, IsGuid, IsAbsNumeric and IsSwedishPersonalNumber

There is a newer version of this package available.
See the version list below for details.
Install-Package EstecheAssemblies -Version 1.0.6
dotnet add package EstecheAssemblies --version 1.0.6
<PackageReference Include="EstecheAssemblies" Version="1.0.6" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add EstecheAssemblies --version 1.0.6
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: EstecheAssemblies, 1.0.6"
#r directive can be used in F# Interactive, C# scripting and .NET Interactive. Copy this into the interactive tool or source code of the script to reference the package.
// Install EstecheAssemblies as a Cake Addin
#addin nuget:?package=EstecheAssemblies&version=1.0.6

// Install EstecheAssemblies as a Cake Tool
#tool nuget:?package=EstecheAssemblies&version=1.0.6
The NuGet Team does not provide support for this client. Please contact its maintainers for support.

Introduction

Good functionalities for developers.


Content

DateTime Extensions

  • ToFriendlyTimeSpan(Language)

Returns a friendly text on the TimeSpan got it for this DateTime until Now.
E.g. "00:00:04" = "4 minutes ago" or “00:05:32” = “5 hours ago”
It is available in English, Chinese, Spanish and Swedish.

  • ToShortFriendlyTimeSpan(Language)

Returns a shorter friendly text on the TimeSpan got it for this DateTime until Now.
E.g. "00:00:04" = "4 min" or “00:05:32” = “5 hr”
It is available in English, Spanish and Swedish. The Chinese has no shorter version.

String Extensions

  • IsAbsNumeric()

Returns a bool telling if a String is an absolut entire number

  • IsDateTime()

Returns a bool telling if a String is a DateTime and returns the value parsed in case it is correct.

  • IsGuid()

Returns a bool telling if a String is a DateTime and returns the value parsed in case it is correct.

  • IsSwedishPersonalNumber()

This is a functionality used in Sweden for validating a personal number (Social Security number)
Returns a bool telling if a String is a correct Swedish Personal Number and in case of Not, it returns the Error Message.

  • ToSecureString()

This functionality convert a string to a SecureString

  • ToPlanString()

This convert a SecureString to a string

  • ToUpperFirstChar()

This turn the first char in a string to UpperCase

  • IsEqualTo(SecureString comparingSecureString)

This function compare is this "SecureString" is equeal to a comparing one.


Good to know

This package is free for everyone to use.
It is open source wroten in C# allocated in AzureRepo: https://dev.azure.com/fuestechefamily/EstecheAssemblies/_git/EstecheAssemblies


Implementation

Add using

using EstecheAssemblies;

ToFriendlyTimeSpan(Language)

var date = new DateTime("2019-08-08 01:03:21");
var friendlyTextEnglish = date.ToFriendlyTimeSpan(Language.English);
var friendlyTextSimplifiedChinese = date.ToFriendlyTimeSpan(Language.SimplifiedChinese);
var friendlyTextTraditionalChinese = date.ToFriendlyTimeSpan(Language.TraditionalChinese);
var friendlyTextSwedish = date.ToFriendlyTimeSpan(Language.Swedish);
var friendlyTextSpanish = date.ToFriendlyTimeSpan(Language.Spanish);
var friendlyTextEnglishDefault = date.ToFriendlyTimeSpan();

ToShortFriendlyTimeSpan(Language)

var date = new DateTime("2019-08-08");
var shorterFriendlyTextEnglish = date.ToShortFriendlyTimeSpan(Language.English);
var shorterFriendlyTextSimplifiedChinese = date.ToShortFriendlyTimeSpan(Language.SimplifiedChinese);
var shorterFriendlyTextTraditionalChinese = date.ToShortFriendlyTimeSpan(Language.TraditionalChinese);
var shorterFriendlyTextSwedish = date.ToShortFriendlyTimeSpan(Language.Swedish);
var shorterFriendlyTextSpanish = date.ToShortFriendlyTimeSpan(Language.Spanish);
var shorterFriendlyTextEnglishDefault = date.ToShortFriendlyTimeSpan();

ToSecureString()

var myPassword = "My Password";
SecureString mySecureString = myPassword.ToSecureString();

ToPlanString()

string myStringPassword = mySecureString.ToPlanString();

ToUpperFirstChar

var myText = "it's a beutifull life";
string betterFormatedText = myText.ToUpperFirstChar();

IsEqualTo(SecureString comparingSecureString)

SecureString mySecureString = "it_is_my_Password".ToSecureString();
SecureString mySecureString2 = "it_is_my_Password".ToSecureString();
bool correctPassword = mySecureString.IsEqualTo(mySecureString2);

IsDateTime()

var text = "2019-08-08-68";
var validDate = text.IsDateTime();

IsGuid()

var text = "6B1A5C52-E10C-471C-422309EC06A1";
var validGuid = text.IsGuid();

IsAbsNumeric()

var text = "6B1A5C52";
var validNumber = text.IsAbsNumeric();

IsAbsNumeric()

var text = "121212-1212";
var validNumber = text.IsSwedishPersonalNumber();

Introduction

Good functionalities for developers.


Content

DateTime Extensions

  • ToFriendlyTimeSpan(Language)

Returns a friendly text on the TimeSpan got it for this DateTime until Now.
E.g. "00:00:04" = "4 minutes ago" or “00:05:32” = “5 hours ago”
It is available in English, Chinese, Spanish and Swedish.

  • ToShortFriendlyTimeSpan(Language)

Returns a shorter friendly text on the TimeSpan got it for this DateTime until Now.
E.g. "00:00:04" = "4 min" or “00:05:32” = “5 hr”
It is available in English, Spanish and Swedish. The Chinese has no shorter version.

String Extensions

  • IsAbsNumeric()

Returns a bool telling if a String is an absolut entire number

  • IsDateTime()

Returns a bool telling if a String is a DateTime and returns the value parsed in case it is correct.

  • IsGuid()

Returns a bool telling if a String is a DateTime and returns the value parsed in case it is correct.

  • IsSwedishPersonalNumber()

This is a functionality used in Sweden for validating a personal number (Social Security number)
Returns a bool telling if a String is a correct Swedish Personal Number and in case of Not, it returns the Error Message.

  • ToSecureString()

This functionality convert a string to a SecureString

  • ToPlanString()

This convert a SecureString to a string

  • ToUpperFirstChar()

This turn the first char in a string to UpperCase

  • IsEqualTo(SecureString comparingSecureString)

This function compare is this "SecureString" is equeal to a comparing one.


Good to know

This package is free for everyone to use.
It is open source wroten in C# allocated in AzureRepo: https://dev.azure.com/fuestechefamily/EstecheAssemblies/_git/EstecheAssemblies


Implementation

Add using

using EstecheAssemblies;

ToFriendlyTimeSpan(Language)

var date = new DateTime("2019-08-08 01:03:21");
var friendlyTextEnglish = date.ToFriendlyTimeSpan(Language.English);
var friendlyTextSimplifiedChinese = date.ToFriendlyTimeSpan(Language.SimplifiedChinese);
var friendlyTextTraditionalChinese = date.ToFriendlyTimeSpan(Language.TraditionalChinese);
var friendlyTextSwedish = date.ToFriendlyTimeSpan(Language.Swedish);
var friendlyTextSpanish = date.ToFriendlyTimeSpan(Language.Spanish);
var friendlyTextEnglishDefault = date.ToFriendlyTimeSpan();

ToShortFriendlyTimeSpan(Language)

var date = new DateTime("2019-08-08");
var shorterFriendlyTextEnglish = date.ToShortFriendlyTimeSpan(Language.English);
var shorterFriendlyTextSimplifiedChinese = date.ToShortFriendlyTimeSpan(Language.SimplifiedChinese);
var shorterFriendlyTextTraditionalChinese = date.ToShortFriendlyTimeSpan(Language.TraditionalChinese);
var shorterFriendlyTextSwedish = date.ToShortFriendlyTimeSpan(Language.Swedish);
var shorterFriendlyTextSpanish = date.ToShortFriendlyTimeSpan(Language.Spanish);
var shorterFriendlyTextEnglishDefault = date.ToShortFriendlyTimeSpan();

ToSecureString()

var myPassword = "My Password";
SecureString mySecureString = myPassword.ToSecureString();

ToPlanString()

string myStringPassword = mySecureString.ToPlanString();

ToUpperFirstChar

var myText = "it's a beutifull life";
string betterFormatedText = myText.ToUpperFirstChar();

IsEqualTo(SecureString comparingSecureString)

SecureString mySecureString = "it_is_my_Password".ToSecureString();
SecureString mySecureString2 = "it_is_my_Password".ToSecureString();
bool correctPassword = mySecureString.IsEqualTo(mySecureString2);

IsDateTime()

var text = "2019-08-08-68";
var validDate = text.IsDateTime();

IsGuid()

var text = "6B1A5C52-E10C-471C-422309EC06A1";
var validGuid = text.IsGuid();

IsAbsNumeric()

var text = "6B1A5C52";
var validNumber = text.IsAbsNumeric();

IsAbsNumeric()

var text = "121212-1212";
var validNumber = text.IsSwedishPersonalNumber();

Release Notes

* Handleing plural or singular hours.

  • .NETStandard 2.0

    • No dependencies.

NuGet packages (1)

Showing the top 1 NuGet packages that depend on EstecheAssemblies:

Package Downloads
BlazorMarkdown2Html
Display markdown files in html format directly in a Blazor with a component. The only think a developer need to do it is to add the path to the file e.g. "ReadMe.md" into the parameter "documentName" and the rest it is handled by the component. If you give the default css it even handle dark and light mode heritated from the webbrowser.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version History

Version Downloads Last updated
1.1.0 41 4/9/2021
1.0.7 609 10/28/2020
1.0.6 909 3/26/2020
1.0.5 550 10/7/2019
1.0.4 266 10/1/2019
1.0.3 220 9/30/2019
1.0.2 245 9/27/2019
1.0.1 221 9/26/2019
1.0.0 225 9/25/2019