Class MudDateRangePicker
- Namespace
- MudBlazor
- Assembly
- MudBlazor.dll
Represents a picker for a range of dates.
public class MudDateRangePicker : MudBaseDatePicker, IComponent, IHandleEvent, IHandleAfterRender, IMudStateHasChanged, IFormComponent, IAsyncDisposable
- Inheritance
-
MudDateRangePicker
- Implements
- Inherited Members
- Extension Methods
Constructors
MudDateRangePicker()
Creates a new instance.
public MudDateRangePicker()
Properties
AllowDisabledDatesInRange
Enables capture for disabled dates within the selected date range.
[Parameter]
[Category("Validation")]
public bool AllowDisabledDatesInRange { get; set; }
Property Value
Remarks
By default, it will always ignore disabled dates. This parameter will take effect when IsDateDisabledFunc is set.
DateRange
The currently selected date range.
[Parameter]
[Category("Data")]
public DateRange DateRange { get; set; }
Property Value
DateRangeChanged
Occurs when DateRange has changed.
[Parameter]
public EventCallback<DateRange> DateRangeChanged { get; set; }
Property Value
InputContent
protected override RenderFragment InputContent { get; }
Property Value
IsRange
protected override bool IsRange { get; }
Property Value
PlaceholderEnd
The text displayed in the end input if no date is specified.
[Parameter]
[Category("Behavior")]
public string PlaceholderEnd { get; set; }
Property Value
Remarks
This property is typically used to give the user a hint as to what kind of input is expected.
PlaceholderStart
The text displayed in the start input if no date is specified.
[Parameter]
[Category("Behavior")]
public string PlaceholderStart { get; set; }
Property Value
Remarks
This property is typically used to give the user a hint as to what kind of input is expected.
SeparatorIcon
The icon displayed between start and end dates.
[Parameter]
[Category("Appearance")]
public string SeparatorIcon { get; set; }
Property Value
Remarks
Defaults to ArrowRightAlt.
Methods
BuildRenderTree(RenderTreeBuilder)
protected override void BuildRenderTree(RenderTreeBuilder __builder)
Parameters
__builder
RenderTreeBuilder
ClearAsync(bool)
Hides this picker.
public override Task ClearAsync(bool close = true)
Parameters
close
boolWhen
true
, the picker will be closed if PickerVariant is not Static.
Returns
DateFormatChangedAsync(string)
Occurs when the DateFormat has changed.
protected override Task DateFormatChangedAsync(string newFormat)
Parameters
newFormat
string
Returns
FocusEndAsync()
Focuses the end input.
public ValueTask FocusEndAsync()
Returns
FocusStartAsync()
Focuses the start input.
public ValueTask FocusStartAsync()
Returns
GetCalendarStartOfMonth()
protected override DateTime GetCalendarStartOfMonth()
Returns
GetCalendarYear(DateTime)
Converts gregorian date into whatever year it is in the provided culture
protected override int GetCalendarYear(DateTime yearDate)
Parameters
yearDate
DateTimeGregorian Date
Returns
- int
Year according to culture
GetDayClasses(int, DateTime)
protected override string GetDayClasses(int month, DateTime day)
Parameters
Returns
GetTitleDateString()
protected override string GetTitleDateString()
Returns
HasValue(DateTime?)
protected override bool HasValue(DateTime? value)
Parameters
value
DateTime?
Returns
OnDayClickedAsync(DateTime)
User clicked on a day
protected override Task OnDayClickedAsync(DateTime dateTime)
Parameters
dateTime
DateTime
Returns
OnOpenedAsync()
protected override Task OnOpenedAsync()
Returns
OnPickerClosedAsync()
protected override Task OnPickerClosedAsync()
Returns
SelectEndAsync()
Selects the end input text.
public ValueTask SelectEndAsync()
Returns
SelectRangeEndAsync(int, int)
Selects a portion of the end input text.
public ValueTask SelectRangeEndAsync(int pos1, int pos2)
Parameters
pos1
intThe index of the first character to select.
pos2
intThe index of the last character to select.
Returns
SelectRangeStartAsync(int, int)
Selects a portion of the start input text.
public ValueTask SelectRangeStartAsync(int pos1, int pos2)
Parameters
pos1
intThe index of the first character to select.
pos2
intThe index of the last character to select.
Returns
SelectStartAsync()
Selects the start input text.
public ValueTask SelectStartAsync()
Returns
SetDateRangeAsync(DateRange, bool)
protected Task SetDateRangeAsync(DateRange range, bool updateValue)
Parameters
Returns
StringValueChangedAsync(string)
Occurs when the string value has changed.
protected override Task StringValueChangedAsync(string value)
Parameters
value
string
Returns
SubmitAsync()
protected override Task SubmitAsync()