HtmlForgeX

API Reference

Class

TablerRelativeTime

Namespace HtmlForgeX
Assembly HtmlForgeX
Base Element
Modifiers sealed

Renders a relative "time ago" label that updates on the client using local time.

Inheritance

Constructors

TablerRelativeTime 2 overloads
public TablerRelativeTime(DateTimeOffset timestampUtc) #

Initializes a new instance of the TablerRelativeTime class using UTC input.

Parameters

timestampUtc System.DateTimeOffset requiredposition: 0
public TablerRelativeTime(DateTime timestamp) #

Initializes a new instance of the TablerRelativeTime class using a DateTime input.

Parameters

timestamp System.DateTime requiredposition: 0

Methods

public TablerRelativeTime AbsoluteFormat(TablerRelativeTimeAbsoluteFormat format) #
Returns: TablerRelativeTime

Sets the absolute time format.

Parameters

format HtmlForgeX.TablerRelativeTimeAbsoluteFormat requiredposition: 0
public TablerRelativeTime AbsoluteOffset(TimeSpan offset) #
Returns: TablerRelativeTime

Sets a fixed offset for absolute time rendering (use with FixedOffset time zone).

Parameters

offset System.TimeSpan requiredposition: 0
public TablerRelativeTime AbsoluteTimeZone(TablerRelativeTimeAbsoluteTimeZone zone) #
Returns: TablerRelativeTime

Sets the time zone used for absolute time rendering.

Parameters

zone HtmlForgeX.TablerRelativeTimeAbsoluteTimeZone requiredposition: 0
public TablerRelativeTime AsBadge(TablerBadgeStyle style = Soft, Nullable<TablerColor> textColor = null) #
Returns: TablerRelativeTime

Renders the label as a badge (uses Tabler badge styling).

Parameters

style HtmlForgeX.TablerBadgeStyle = Soft optionalposition: 0
textColor System.Nullable{HtmlForgeX.TablerColor} = null optionalposition: 1
public TablerRelativeTime DefaultColor(TablerColor color) #
Returns: TablerRelativeTime

Sets the default color class when no threshold matches.

Parameters

color HtmlForgeX.TablerColor requiredposition: 0
public TablerRelativeTime Locale(String locale) #
Returns: TablerRelativeTime

Sets the locale used for absolute time rendering (e.g., "pl-PL").

Parameters

locale System.String requiredposition: 0
public TablerRelativeTime Mode(TablerRelativeTimeDisplayMode mode) #
Returns: TablerRelativeTime

Sets the display mode for the label.

Parameters

mode HtmlForgeX.TablerRelativeTimeDisplayMode requiredposition: 0
RegisterLibraries() #
public TablerRelativeTime RelativeStyle(TablerRelativeTimeRelativeStyle style) #
Returns: TablerRelativeTime

Sets the relative time label style.

Parameters

style HtmlForgeX.TablerRelativeTimeRelativeStyle requiredposition: 0
public TablerRelativeTime Threshold(TimeSpan age, TablerColor color) #
Returns: TablerRelativeTime

Adds a color threshold for age-based styling.

Parameters

age System.TimeSpan requiredposition: 0
color HtmlForgeX.TablerColor requiredposition: 1
public TablerRelativeTime Thresholds(IEnumerable<TablerRelativeTimeThreshold> thresholds) #
Returns: TablerRelativeTime

Adds multiple thresholds at once.

Parameters

thresholds System.Collections.Generic.IEnumerable{HtmlForgeX.TablerRelativeTimeThreshold} requiredposition: 0
public TablerRelativeTime TooltipAbsolute(Boolean enable = true) #
Returns: TablerRelativeTime

Enables or disables the absolute-time tooltip (local time).

Parameters

enable System.Boolean = true optionalposition: 0
public override String ToString() #
Returns: String
public TablerRelativeTime UpdateEvery(Nullable<TimeSpan> interval) #
Returns: TablerRelativeTime

Enables automatic refresh on the client. Set to null or zero to disable.

Parameters

interval System.Nullable{System.TimeSpan} requiredposition: 0