CafeExtensions 1.0.5

There is a newer version of this package available.
See the version list below for details.
dotnet add package CafeExtensions --version 1.0.5
NuGet\Install-Package CafeExtensions -Version 1.0.5
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="CafeExtensions" Version="1.0.5" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add CafeExtensions --version 1.0.5
#r "nuget: CafeExtensions, 1.0.5"
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install CafeExtensions as a Cake Addin
#addin nuget:?package=CafeExtensions&version=1.0.5

// Install CafeExtensions as a Cake Tool
#tool nuget:?package=CafeExtensions&version=1.0.5

New method, ToStringTime, is designed to format a given date and time into a human-readable text format suitable for the Russian region. It takes two parameters:

  1. date: The long value representing the date and time that you want to format.
  2. isLastLogin: A boolean flag that indicates whether this formatting is for the last login timestamp.

Here's what the method does:

  • It calculates the time span between the current date and time and the provided date parameter.
  • The method distinguishes between two scenarios: formatting for user-related timestamps (e.g., "Was online 5 minutes ago") and formatting for message-related timestamps (e.g., "12:30 PM" or "Monday").
  • For user-related timestamps (isLastLogin is true), it generates strings like "Was online just now," "Was online 5 minutes ago," "Was online 2 hours ago," "Was online 3 days ago," "Was online a week ago," "Was online 2 weeks ago," "Was online 3 weeks ago," or "Was online 4 weeks ago," depending on the time elapsed.
  • For message-related timestamps (isLastLogin is false), it produces timestamps in the format "HH:mm" for timestamps within the last 24 hours, short day names (e.g., "Mon," "Tue") for timestamps within the last 30 days, "dd.MM" format for timestamps within the last 12 months, and "dd.MM.yy" format for timestamps older than 12 months.

This method is useful for displaying user and message timestamps in a user-friendly and context-appropriate manner, making it easier for users to understand when an action or message occurred.

Product Compatible and additional computed target framework versions.
.NET net6.0 is compatible.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • net6.0

    • No dependencies.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
1.1.3 106 3/11/2024
1.1.2 241 11/8/2023
1.1.1 132 11/7/2023
1.1.0 109 11/2/2023
1.0.9 109 10/31/2023
1.0.8 197 10/15/2023
1.0.7 126 10/11/2023
1.0.6 133 9/27/2023
1.0.5 96 9/26/2023
1.0.4 142 9/25/2023
1.0.2 109 9/21/2023
1.0.1 105 9/21/2023
1.0.0 96 9/21/2023