This service is available via Telligent.Evolution.Extensibility.Api.Version1.PublicApi.Language
or Telligent.Evolution.Extensibility.Apis.Get<Telligent.Evolution.Extensibility.Api.Version1.ILanguage>()
and is defined in Telligent.Evolution.Api.dll
Methods
string FormatAgoDate(DateTime date);
Formats a date as a readable 'time ago' format
Parameters
Name | Type | Description | Required | Default | Options |
---|---|---|---|---|---|
date | DateTime | Date | Required |
Return Type
string
string FormatDataSize(int size);
Formats a data size
Parameters
Name | Type | Description | Required | Default | Options |
---|---|---|---|---|---|
size | int | Size | Required |
Return Type
string
string FormatDate(DateTime date, LanguageFormatDateOptions options);
Formats a date to a custom date format and or adjusted time zone
Parameters
Name | Type | Description | Required | Default | Options |
---|---|---|---|---|---|
date | DateTime | Date | Required | ||
options | LanguageFormatDateOptions | Options include: Format, AdjustTimeZone | Required |
Return Type
string
string FormatDate(DateTime date);
Formats a date to the default date format
Parameters
Name | Type | Description | Required | Default | Options |
---|---|---|---|---|---|
date | DateTime | Date | Required |
Return Type
string
string FormatDate(DateTime date, string format);
Formats a date to a custom date format
Parameters
Name | Type | Description | Required | Default | Options |
---|---|---|---|---|---|
date | DateTime | Date | Required | ||
format | string | Supports standard and custom datetime formats as defined msdn.microsoft.com/.../az4se3k1.aspx and msdn.microsoft.com/.../8kb3ddd4.aspx | Required |
Return Type
string
string FormatDateAndTime(DateTime date, bool adjustTimeZone = True);
Formats a date to the default date and time format
Parameters
Name | Type | Description | Required | Default | Options |
---|---|---|---|---|---|
date | DateTime | Date | Required | ||
adjustTimeZone | bool | Adjust Time Zone | Optional | True |
Return Type
string
string FormatNumber(double number);
Formats a number
Parameters
Name | Type | Description | Required | Default | Options |
---|---|---|---|---|---|
number | double | Number | Required |
Return Type
string
string FormatNumber(int number);
Formats a number
Parameters
Name | Type | Description | Required | Default | Options |
---|---|---|---|---|---|
number | int | Number | Required |
Return Type
string
string FormatString(string format, params string[] parameters);
Replaces each format item in a specified string with the text equivalent of a corresponding object's value.
Parameters
Name | Type | Description | Required | Default | Options |
---|---|---|---|---|---|
format | string | Format string including indexed placeholders: {0}, {1}, {2}, etc | Required | ||
parameters | string[] | Parameters | Required |
Return Type
string
string FormatUrl(string url);
Formats a URL
Parameters
Name | Type | Description | Required | Default | Options |
---|---|---|---|---|---|
url | string | Url | Required |
Return Type
string
string GetInitials(string fullName);
Returns initials for a full name
Parameters
Name | Type | Description | Required | Default | Options |
---|---|---|---|---|---|
fullName | string | Full Name | Required |
Return Type
string
string Lowercase(string text);
Converts a string to lower-case
Parameters
Name | Type | Description | Required | Default | Options |
---|---|---|---|---|---|
text | string | Text | Required |
Return Type
string
string RemoveHtml(string html);
Removes HTML from a string
Parameters
Name | Type | Description | Required | Default | Options |
---|---|---|---|---|---|
html | string | Html | Required |
Return Type
string
string Truncate(string text, int desiredLength, string ellipsis, List<string> allowedHtmlTags);
Truncates text as close to the desiredLength as possible without breaking words. Also removes HTML
Parameters
Name | Type | Description | Required | Default | Options |
---|---|---|---|---|---|
text | string | Text | Required | ||
desiredLength | int | Desired length | Required | ||
ellipsis | string | String to show in place of truncated text | Required | ||
allowedHtmlTags | List<string> | Keep these html tags in the results, html tags aren't included in the length count. | Required |
Return Type
string
string Truncate(string text, int desiredLength, string ellipsis);
Truncates text as close to the desiredLength as possible without breaking words. Also removes HTML
Parameters
Name | Type | Description | Required | Default | Options |
---|---|---|---|---|---|
text | string | Text | Required | ||
desiredLength | int | Desired length | Required | ||
ellipsis | string | String to show in place of truncated text | Required |
Return Type
string
string Uppercase(string text);
Converts a string to upper-case
Parameters
Name | Type | Description | Required | Default | Options |
---|---|---|---|---|---|
text | string | Text | Required |
Return Type
string