Table of Contents

Class DateTimeField<T>

Namespace
AbanoubNassem.Trinity.Fields
Assembly
AbanoubNassem.Trinity.dll

A field for storing and displaying dates and times.

public class DateTimeField<T> : TrinityField<DateTimeField<T>, T>, ITrinityComponent, ITrinityField, IFormComponent

Type Parameters

T
Inheritance
DateTimeField<T>
Implements
Derived
Inherited Members

Constructors

DateTimeField(string)

public DateTimeField(string columnName)

Parameters

columnName string

Properties

ComponentName

The component name in the front-end side.

public override string ComponentName { get; }

Property Value

string

DateFormat

Gets or sets the date format of the date time field.

public string? DateFormat { get; protected set; }

Property Value

string

DisabledDates

Gets or sets an array of disabled dates. If a date is present in this array, it will be disabled in the date picker.

public DateTime[]? DisabledDates { get; protected set; }

Property Value

DateTime[]

DisabledDays

Gets or sets the days of the week that are disabled in the date and time field.

public int[]? DisabledDays { get; protected set; }

Property Value

int[]

HourFormat

Gets or sets the hour format of the date time field.

public string? HourFormat { get; protected set; }

Property Value

string

IconPos

Gets or sets the position of the icon in the date picker.

public string? IconPos { get; protected set; }

Property Value

string

Inline

Gets or sets a value indicating whether the date time field should be displayed inline.

public bool Inline { get; protected set; }

Property Value

bool

MaxDate

Gets or sets the maximum date value allowed in the date and time field.

public DateTime? MaxDate { get; protected set; }

Property Value

DateTime?

MinDate

Gets or sets the minimum date value allowed in the date and time field.

public DateTime? MinDate { get; protected set; }

Property Value

DateTime?

SelectionMode

Gets or sets the selection mode of the date time field.

public string SelectionMode { get; protected set; }

Property Value

string

ShowIcon

Gets or sets a value indicating whether to show an icon in the date picker.

public bool ShowIcon { get; protected set; }

Property Value

bool

ShowTime

Gets or sets a value indicating whether to show the time portion of the date and time field.

public bool ShowTime { get; protected set; }

Property Value

bool

TimeOnly

Gets or sets a value indicating whether to display only the time portion of the date and time field.

public bool TimeOnly { get; protected set; }

Property Value

bool

View

Gets or sets the current view of the date picker.

public string? View { get; protected set; }

Property Value

string

Methods

SetAsInline(bool)

Sets the date time field to be displayed inline or not.

public DateTimeField<T> SetAsInline(bool inline = true)

Parameters

inline bool

A boolean value indicating whether the field should be displayed inline or not.

Returns

DateTimeField<T>

The current instance of the DateTimeField class.

SetDateFormat(string)

Sets the date format of the date time field.

public DateTimeField<T> SetDateFormat(string format)

Parameters

format string

The format to be set.

Returns

DateTimeField<T>

The current instance of the DateTimeField class.

SetDisabledDates(params DateTime[])

Sets an array of disabled dates. If a date is present in this array, it will be disabled in the date picker.

public DateTimeField<T> SetDisabledDates(params DateTime[] dates)

Parameters

dates DateTime[]

An array of dates to disable.

Returns

DateTimeField<T>

The current instance of the DateTimeField<T> class.

SetDisabledDays(params int[])

Sets the days of the week that are disabled in the date and time field.

public DateTimeField<T> SetDisabledDays(params int[] days)

Parameters

days int[]

An array of integers representing the days of the week to disable in the date and time field.

Returns

DateTimeField<T>

The current instance of the DateTimeField<T> class.

SetHourFormat(HourFormatTypes)

Sets the hour format of the date time field.

public DateTimeField<T> SetHourFormat(HourFormatTypes format = HourFormatTypes.AmPm)

Parameters

format HourFormatTypes

The type of hour format to be set.

Returns

DateTimeField<T>

The current instance of the DateTimeField class.

SetMaxDate(DateTime)

Sets the maximum date value allowed in the date and time field.

public DateTimeField<T> SetMaxDate(DateTime max)

Parameters

max DateTime

The maximum date value allowed in the date and time field.

Returns

DateTimeField<T>

The current instance of the DateTimeField<T> class.

SetMinDate(DateTime)

Sets the minimum date value allowed in the date and time field.

public DateTimeField<T> SetMinDate(DateTime min)

Parameters

min DateTime

The minimum date value allowed in the date and time field.

Returns

DateTimeField<T>

The current instance of the DateTimeField<T> class.

SetShowIcon(bool, string)

Sets a value indicating whether to show an icon in the date picker and its position.

public DateTimeField<T> SetShowIcon(bool show = true, string iconPos = "left")

Parameters

show bool

True to show the icon, false to hide it.

iconPos string

The position of the icon. Valid values are "left" and "right".

Returns

DateTimeField<T>

The current instance of the DateTimeField<T> class.

SetShowTime(bool)

Sets the value indicating whether to show the time portion of the date and time field.

public DateTimeField<T> SetShowTime(bool show = true)

Parameters

show bool

A value indicating whether to show the time portion of the date and time field. Default is true.

Returns

DateTimeField<T>

The current instance of the DateTimeField<T> class.

SetTimeOnly(bool)

Sets the value indicating whether to display only the time portion of the date and time field.

public DateTimeField<T> SetTimeOnly(bool timeOnly = true)

Parameters

timeOnly bool

A value indicating whether to display only the time portion of the date and time field. Default is true.

Returns

DateTimeField<T>

The current instance of the DateTimeField<T> class.

SetView(ViewTypes)

Sets the view of the date picker.

public DateTimeField<T> SetView(ViewTypes view)

Parameters

view ViewTypes

The view type to set.

Returns

DateTimeField<T>

The current instance of the DateTimeField<T> class.