Table of Contents

Class DateTimeExtensions

Namespace
Dynamicweb.Frontend
Assembly
Dynamicweb.dll

Provides extension methods for DateTime to facilitate displaying time intervals in a user-friendly format for frontend Razor templates.

public static class DateTimeExtensions
Inheritance
DateTimeExtensions
Inherited Members

Methods

GetTimeAgo(DateTime)

Returns a TimeAgoInfo object that represents the time elapsed since the specified DateTime in a human-readable format.

public static TimeAgoInfo? GetTimeAgo(this DateTime dateTime)

Parameters

dateTime DateTime

The DateTime to calculate the time ago from.

Returns

TimeAgoInfo

A TimeAgoInfo object containing the value and label of the time elapsed, or null if the dateTime is in the future.

To top