HtmlForgeX

API Reference

Class

TemporalValueTransformer

Namespace HtmlForgeX
Assembly HtmlForgeX

Formats DateTime, DateTimeOffset and TimeSpan values for display in DataTables. Configure via Settings(s => s.TemporalFormatting(...)).

Inheritance

  • Object
  • TemporalValueTransformer

Constructors

Methods

public virtual Boolean TryTransform(Object value, out Object rendered) #
Returns: Boolean

Parameters

value System.Object requiredposition: 0
rendered System.Object@ requiredposition: 1

Properties

public String DateTimeFormat { get; set; } #

Format string used for DateTime values. Defaults to "yyyy-MM-dd HH:mm".

public String DateOnlyFormat { get; set; } #

Format string used when a DateTime has TimeOfDay == 00:00:00. Defaults to "yyyy-MM-dd".

public String DateTimeOffsetFormat { get; set; } #

Format string used for DateTimeOffset values. When null, uses DateTimeFormat.

public Boolean UtcToLocal { get; set; } #

When true, converts UTC DateTime/DateTimeOffset to local time before formatting.

public DataTablesTimeSpanFormat TimeSpanFormat { get; set; } #

Formatting mode for TimeSpan values.

public String CustomTimeSpanFormat { get; set; } #

Custom TimeSpan format string (e.g., "dd\\:hh\\:mm"). Used only when TimeSpanFormat is Custom.

public Boolean RelativeDates { get; set; } #

Show relative "time ago" display for dates (e.g., "3 days ago"). When true, adds data-order and title for sort/tooltip.

public Boolean RelativeTooltip { get; set; } #

When RelativeDates is true, adds a tooltip with the absolute timestamp.