Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
@page "/muddatetimepicker"
@namespace MudExtensions.Docs.Pages

<ExamplePage Component="typeof(MudDateTimePicker<>)">
<ExampleCard ComponentName="DateTimePicker" ExampleName="DateTimePickerExample1" Title="Usage" Description="MudDateTimePicker handles date and time selection itself.">
<DateTimePickerExample1 />
</ExampleCard>
<ExampleCard ComponentName="DateTimePicker" ExampleName="DateTimePickerExample2" Title="Generic Types" Description="MudDateTimePicker supports DateTime and DateTimeOffset.">
<DateTimePickerExample2 />
</ExampleCard>
<ExampleCard ComponentName="DateTimePicker" ExampleName="DateTimePickerExample3" Title="Action Buttons" Description="Submit strategy can be handled via Action Buttons and AutoClose parameter.">
<DateTimePickerExample3 />
</ExampleCard>
</ExamplePage>
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
@namespace MudExtensions.Docs.Examples
@using MudBlazor.Extensions

<MudGrid>
<MudItem xs="12" sm="8">
<MudDateTimePicker @bind-Value="_date" Editable="_editable" Label="Date" Clearable="_clearable" AmPm="_amPm"
ShowToolbar="_showToolbar" Variant="_variant" Color="_color" DateFormat="@_dateFormat" />
</MudItem>

<MudItem xs="12" sm="4">
<MudStack Spacing="2">
<MudSelect @bind-Value="_variant" Variant="Variant.Outlined" Label="Variant" Margin="Margin.Dense">
@foreach (Variant item in Enum.GetValues<Variant>())
{
<MudSelectItem Value="item">@item.ToDescriptionString()</MudSelectItem>
}
</MudSelect>
<MudSwitchM3 @bind-Value="_editable" Color="Color.Secondary" Label="Editable" />
<MudSwitchM3 @bind-Value="_clearable" Color="Color.Secondary" Label="Clearable" />
<MudSwitchM3 @bind-Value="_showToolbar" Color="Color.Secondary" Label="Show Toolbar" />
<MudSwitchM3 @bind-Value="_amPm" Label="AmPm" Color="Color.Secondary" />
<MudSelect @bind-Value="_color" Variant="Variant.Outlined" Label="Color" Margin="Margin.Dense">
@foreach (Color item in Enum.GetValues<Color>())
{
<MudSelectItem Value="item">@item.ToDescriptionString()</MudSelectItem>
}
</MudSelect>
<MudTextField @bind-Value="_dateFormat" Variant="Variant.Outlined" Label="Date Format" Margin="Margin.Dense" />
<MudButton OnClick="@(() => _date = DateTime.Now)">Set Today</MudButton>
</MudStack>
</MudItem>
</MudGrid>

@code {
private DateTime? _date = DateTime.Now;
private bool _editable = false;
private bool _showToolbar = true;
private Color _color = Color.Primary;
private string? _dateFormat;
private bool _clearable = false;
private Variant _variant = Variant.Outlined;
private bool _amPm = false;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
@namespace MudExtensions.Docs.Examples
@using MudBlazor.Extensions

<MudGrid>
<MudItem xs="12" sm="8">
<MudDateTimePicker @bind-Value="_date" Editable="_editable" Label="DateTime" Clearable="_clearable" Variant="Variant.Outlined" Color="Color.Primary" />
<MudDateTimePicker @bind-Value="_date2" Editable="_editable" Label="DateTimeOffset" Clearable="_clearable" Variant="Variant.Outlined" Color="Color.Primary" />
<MudDateTimePicker @bind-Value="_date2" Editable="_editable" Label="TimeZone Istanbul" Clearable="_clearable" Variant="Variant.Outlined" Color="Color.Primary"
TimeZone="@TimeZoneInfo.FindSystemTimeZoneById("Europe/Istanbul")" />
<MudDateTimePicker @bind-Value="_date3" Editable="_editable" Label="DateOnly" Clearable="_clearable" Variant="Variant.Outlined" Color="Color.Primary" />
</MudItem>

<MudItem xs="12" sm="4">
<MudStack Spacing="2">
<MudSwitchM3 @bind-Value="_editable" Color="Color.Secondary" Label="Editable" />
<MudSwitchM3 @bind-Value="_clearable" Color="Color.Secondary" Label="Clearable" />
</MudStack>
</MudItem>
</MudGrid>

@code {
private DateTime? _date = DateTime.Now;
private DateTimeOffset _date2 = DateTimeOffset.UtcNow;
private DateOnly _date3 = DateOnly.FromDateTime(DateTime.Now);
private bool _clearable = false;
private bool _editable = false;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
@namespace MudExtensions.Docs.Examples
@using MudBlazor.Extensions

<MudGrid>
<MudItem xs="12" sm="8">
<MudDateTimePicker @ref="_picker" @bind-Value="_date" Editable="_editable" Label="Date" Clearable="_clearable"
ShowToolbar="_showToolbar" Variant="_variant" Color="_color" DateFormat="@_dateFormat">
<PickerActions>
<MudButton Class="mr-auto align-self-start" OnClick="@(() => _picker.ClearAsync())">Clear</MudButton>
<MudButton OnClick="@(() => _picker.CloseAsync(false))">Cancel</MudButton>
<MudButton Color="Color.Primary" OnClick="@(() => _picker.CloseAsync())">OK</MudButton>
</PickerActions>
</MudDateTimePicker>
</MudItem>

<MudItem xs="12" sm="4">
<MudStack Spacing="2">
<MudSelect @bind-Value="_variant" Variant="Variant.Outlined" Label="Variant">
@foreach (Variant item in Enum.GetValues<Variant>())
{
<MudSelectItem Value="item">@item.ToDescriptionString()</MudSelectItem>
}
</MudSelect>
<MudSwitchM3 @bind-Value="_editable" Color="Color.Secondary" Label="Editable" />
<MudSwitchM3 @bind-Value="_showToolbar" Color="Color.Secondary" Label="Show Toolbar" />
<MudSwitchM3 @bind-Value="_submitOnClose" Color="Color.Secondary" Label="Submit On Close" />
<MudSwitchM3 @bind-Value="_isAdornmentEnd" Label="Adornment End" Color="Color.Secondary" />
<MudSelect @bind-Value="_color" Variant="Variant.Outlined" Label="Color">
@foreach (Color item in Enum.GetValues<Color>())
{
<MudSelectItem Value="item">@item.ToDescriptionString()</MudSelectItem>
}
</MudSelect>
<MudTextField @bind-Value="_dateFormat" Variant="Variant.Outlined" Label="Date Format" />
<MudButton OnClick="@(() => _date = DateTime.Now)">Set Today</MudButton>
</MudStack>
</MudItem>
</MudGrid>

@code {
private MudDateTimePicker<DateTime?> _picker = null!;

private DateTime? _date = DateTime.Now;
private bool _editable = false;
private bool _showToolbar = true;
private bool _submitOnClose = true;
private Color _color = Color.Primary;
private string? _dateFormat;
private bool _isAdornmentEnd = true;
private bool _clearable = false;
private Variant _variant = Variant.Outlined;
}
Loading
Loading