New to Telerik UI for WinForms? Start a free 30-day trial

Provides centralized formatting of TimeStamp values displayed by chat reply bubbles (both the in-conversation bubble and the input preview bubble).

Resolution order used by Format(DateTime, string, Func<DateTime, string>):

  1. The instance-level formatter delegate, if not null.
  2. The instance-level format string, if not null or empty.
  3. DefaultTimestampFormat, if not null or empty.
  4. Built-in adaptive format: short time for today's messages, short date + time otherwise.

Definition

Namespace:Telerik.WinControls.UI

Assembly:Telerik.WinControls.UI.dll

Syntax:

C#
public static class ChatTimestampFormatter

Inheritance: objectChatTimestampFormatter

Properties

Gets or sets the global default timestamp format string used when no per-instance format or formatter is configured. When null or empty, the built-in adaptive logic is used (short time for today's messages, short date + time otherwise).

C#
public static string DefaultTimestampFormat { get; set; }

Methods

Formats the supplied timestamp using the configured resolution order. Returns Empty when timeStamp equals the default value.

C#
public static string Format(DateTime timeStamp, string format, Func<DateTime, string> formatter)
Parameters:timeStampDateTime

The timestamp to format.

formatstring

An optional instance-level format string overriding the global default.

formatterFunc<DateTime, string>

An optional instance-level formatter delegate overriding all format strings.

Returns:

string