Click or drag to resize

ExtensionDateWebDisplayDateOnly Method

Date web display date only (example: 01.12.2021)

Namespace:  Velo.Data.Helper
Assembly:  Velo.Data (in Velo.Data.dll) Version: 22.2.10.1 (22.2.10.450)
Syntax
public static string DateWebDisplayDateOnly(
	this Nullable<DateTime> pDate
)

Parameters

pDate
Type: SystemNullableDateTime

Return Value

Type: String

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type NullableDateTime. When you use instance method syntax to call this method, omit the first parameter. For more information, see Extension Methods (Visual Basic) or Extension Methods (C# Programming Guide).
Exceptions
ExceptionCondition
Exception Exception message: startIndex cannot be larger than length of string. Parameter name: startIndex.

Gives an empty text return.

Remarks
Declaration statement
Using Velo.Data.Helper

If the date formatting gives an exception, then an empty text is returned.

Use for table (DataTables) date sorting.

Examples
Declaration in JavaScript on DataTables
$('#TableBikeHistory').DataTable({
    "language": { "url": URLRoot + "DataTables/German.json" },
    "iDisplayLength": 50,
    columnDefs: [
        { type: 'de_date', targets: 1 },
        { type: 'de_date', targets: 2 }
    ]
});
See Also