Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
a8095a9
Add GetDateTimeOrNull behavior
w3ori Aug 26, 2026
9174ad6
Update DateTimePicker docs/examples for more generic types
w3ori Aug 26, 2026
414ab17
Expand DateTimePickerTests for more input scenarios
w3ori Aug 26, 2026
e395586
Add ValueOnClear and update ClearAsync behavior
w3ori Sep 14, 2026
8250947
Preserve min date values in picker
w3ori Sep 14, 2026
806646f
Add ValueOnClear docs and DateTimePicker tests
w3ori Sep 16, 2026
1ad8c46
Fix empty-state date picker behavior
w3ori Sep 16, 2026
9c4adbc
Revert "Fix empty-state date picker behavior"
w3ori Sep 21, 2026
3e02608
MudDateTimePicker ValueOnClear examples
w3ori Sep 21, 2026
242b25c
readd MinifyMudExtensionsJs
w3ori Sep 21, 2026
d63c600
Merge branch 'dev' into fix/datetimepicker-dateonly-default
w3ori Sep 21, 2026
d4e778e
fix indent
w3ori Sep 21, 2026
276d866
add test
w3ori Sep 21, 2026
d115b20
fix
w3ori Sep 21, 2026
88ddd02
example 2
w3ori Sep 21, 2026
144cf31
new line
w3ori Sep 21, 2026
d852973
add tests
w3ori Sep 21, 2026
40dd028
undo
w3ori Sep 22, 2026
ccea6a3
open at current date
w3ori Sep 22, 2026
56686da
add missing xml comments
w3ori Sep 22, 2026
ba2b5f2
fix comments
w3ori Sep 22, 2026
270e1df
open default DateTimeOffset values in current month
w3ori Sep 22, 2026
e84b107
Remove unnecessary blank lines in DateTimePickerExample2
w3ori Sep 22, 2026
e65d6a7
DatePicker: keep header stable and prefer MinDate; avoid header chang…
w3ori Sep 29, 2026
3ba9dff
Build: update docs XML
w3ori Sep 29, 2026
eaba1df
remove spaces
w3ori Sep 29, 2026
18a0963
Tests: cover header/minDate behavior and BoundDateOrNull for DateTime…
w3ori Oct 1, 2026
43c15c2
Tests: run SetDateAsync on renderer thread to avoid Dispatcher errors
w3ori Oct 1, 2026
de7e833
Tests: increase DateTimePicker coverage for time handling and interac…
w3ori Oct 1, 2026
a7167e8
Tests: fix remaining DateTimePicker invocation issues and improve sta…
w3ori Oct 1, 2026
cc12d47
Fix: prefer Today for header when PickerMonth not explicitly set
w3ori Oct 5, 2026
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
Expand Up @@ -5,7 +5,7 @@
<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.">
<ExampleCard ComponentName="DateTimePicker" ExampleName="DateTimePickerExample2" Title="Generic Types" Description="MudDateTimePicker supports DateTime, DateTimeOffset and DateOnly.">
<DateTimePickerExample2 />
</ExampleCard>
<ExampleCard ComponentName="DateTimePicker" ExampleName="DateTimePickerExample3" Title="Action Buttons" Description="Submit strategy can be handled via Action Buttons and AutoClose parameter.">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,25 @@

<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" />
<MudStack Spacing="2">
<MudDateTimePicker @bind-Value="_dateTime" Editable="_editable"
Label="DateTime" Clearable="_clearable" Variant="Variant.Outlined" Color="Color.Primary" />
<MudDateTimePicker @bind-Value="_nullableDateTime" Editable="_editable" Label="DateTime?"
Clearable="_clearable" Variant="Variant.Outlined" Color="Color.Primary" />

<MudDateTimePicker @bind-Value="_dateTimeOffset" Editable="_editable" Label="DateTimeOffset"
Clearable="_clearable" Variant="Variant.Outlined" Color="Color.Primary" />
<MudDateTimePicker @bind-Value="_nullableDateTimeOffset" Editable="_editable" Label="DateTimeOffset?" Clearable="_clearable" Variant="Variant.Outlined"
Color="Color.Primary" />
<MudDateTimePicker @bind-Value="_istanbulDateTimeOffset" Editable="_editable" Label="TimeZone Istanbul"
Clearable="_clearable" Variant="Variant.Outlined" Color="Color.Primary"
TimeZone="@IstanbulTimeZone" />

<MudDateTimePicker @bind-Value="_dateOnly" Editable="_editable" Label="DateOnly" Clearable="_clearable" Variant="Variant.Outlined"
Color="Color.Primary" />
<MudDateTimePicker @bind-Value="_nullableDateOnly" Editable="_editable" Label="DateOnly?"
Clearable="_clearable" Variant="Variant.Outlined" Color="Color.Primary" />
</MudStack>
</MudItem>

<MudItem xs="12" sm="4">
Expand All @@ -19,9 +33,14 @@
</MudGrid>

@code {
private DateTime? _date = DateTime.Now;
private DateTimeOffset _date2 = DateTimeOffset.UtcNow;
private DateOnly _date3 = DateOnly.FromDateTime(DateTime.Now);
private static readonly TimeZoneInfo IstanbulTimeZone = TimeZoneInfo.FindSystemTimeZoneById("Europe/Istanbul");
private DateTime _dateTime = DateTime.Now;
private DateTime? _nullableDateTime;
private DateTimeOffset _dateTimeOffset = DateTimeOffset.UtcNow;
private DateTimeOffset _istanbulDateTimeOffset = TimeZoneInfo.ConvertTime(DateTimeOffset.UtcNow, IstanbulTimeZone);
private DateTimeOffset? _nullableDateTimeOffset;
private DateOnly _dateOnly = DateOnly.FromDateTime(DateTime.Now);
private DateOnly? _nullableDateOnly;
private bool _clearable = false;
private bool _editable = false;
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,61 @@

<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>
<MudStack Spacing="2">
<MudDateTimePicker @ref="_dateTimePicker" @bind-Value="_dateTime" Editable="_editable" Label="DateTime" Clearable="_clearable"
ShowToolbar="_showToolbar" Variant="_variant" Color="_color" DateFormat="@_dateFormat">
<PickerActions>
<MudButton Class="mr-auto align-self-start" OnClick="@(() => _dateTimePicker.ClearAsync())">Clear</MudButton>
<MudButton OnClick="@(() => _dateTimePicker.CloseAsync(false))">Cancel</MudButton>
<MudButton Color="Color.Primary" OnClick="@(() => _dateTimePicker.CloseAsync())">OK</MudButton>
</PickerActions>
</MudDateTimePicker>

<MudDateTimePicker @ref="_nullableDateTimePicker" @bind-Value="_nullableDateTime" Editable="_editable" Label="DateTime?" Clearable="_clearable"
ShowToolbar="_showToolbar" Variant="_variant" Color="_color" DateFormat="@_dateFormat">
<PickerActions>
<MudButton Class="mr-auto align-self-start" OnClick="@(() => _nullableDateTimePicker.ClearAsync())">Clear</MudButton>
<MudButton OnClick="@(() => _nullableDateTimePicker.CloseAsync(false))">Cancel</MudButton>
<MudButton Color="Color.Primary" OnClick="@(() => _nullableDateTimePicker.CloseAsync())">OK</MudButton>
</PickerActions>
</MudDateTimePicker>

<MudDateTimePicker @ref="_dateTimeOffsetPicker" @bind-Value="_dateTimeOffset" Editable="_editable" Label="DateTimeOffset" Clearable="_clearable"
ShowToolbar="_showToolbar" Variant="_variant" Color="_color" DateFormat="@_dateFormat">
<PickerActions>
<MudButton Class="mr-auto align-self-start" OnClick="@(() => _dateTimeOffsetPicker.ClearAsync())">Clear</MudButton>
<MudButton OnClick="@(() => _dateTimeOffsetPicker.CloseAsync(false))">Cancel</MudButton>
<MudButton Color="Color.Primary" OnClick="@(() => _dateTimeOffsetPicker.CloseAsync())">OK</MudButton>
</PickerActions>
</MudDateTimePicker>

<MudDateTimePicker @ref="_nullableDateTimeOffsetPicker" @bind-Value="_nullableDateTimeOffset" Editable="_editable" Label="DateTimeOffset?" Clearable="_clearable"
ShowToolbar="_showToolbar" Variant="_variant" Color="_color" DateFormat="@_dateFormat">
<PickerActions>
<MudButton Class="mr-auto align-self-start" OnClick="@(() => _nullableDateTimeOffsetPicker.ClearAsync())">Clear</MudButton>
<MudButton OnClick="@(() => _nullableDateTimeOffsetPicker.CloseAsync(false))">Cancel</MudButton>
<MudButton Color="Color.Primary" OnClick="@(() => _nullableDateTimeOffsetPicker.CloseAsync())">OK</MudButton>
</PickerActions>
</MudDateTimePicker>

<MudDateTimePicker @ref="_dateOnlyPicker" @bind-Value="_dateOnly" Editable="_editable" Label="DateOnly" Clearable="_clearable"
ShowToolbar="_showToolbar" Variant="_variant" Color="_color" DateFormat="@_dateFormat">
<PickerActions>
<MudButton Class="mr-auto align-self-start" OnClick="@(() => _dateOnlyPicker.ClearAsync())">Clear</MudButton>
<MudButton OnClick="@(() => _dateOnlyPicker.CloseAsync(false))">Cancel</MudButton>
<MudButton Color="Color.Primary" OnClick="@(() => _dateOnlyPicker.CloseAsync())">OK</MudButton>
</PickerActions>
</MudDateTimePicker>

<MudDateTimePicker @ref="_nullableDateOnlyPicker" @bind-Value="_nullableDateOnly" Editable="_editable" Label="DateOnly?" Clearable="_clearable"
ShowToolbar="_showToolbar" Variant="_variant" Color="_color" DateFormat="@_dateFormat">
<PickerActions>
<MudButton Class="mr-auto align-self-start" OnClick="@(() => _nullableDateOnlyPicker.ClearAsync())">Clear</MudButton>
<MudButton OnClick="@(() => _nullableDateOnlyPicker.CloseAsync(false))">Cancel</MudButton>
<MudButton Color="Color.Primary" OnClick="@(() => _nullableDateOnlyPicker.CloseAsync())">OK</MudButton>
</PickerActions>
</MudDateTimePicker>
</MudStack>
</MudItem>

<MudItem xs="12" sm="4">
Expand All @@ -32,15 +79,25 @@
}
</MudSelect>
<MudTextField @bind-Value="_dateFormat" Variant="Variant.Outlined" Label="Date Format" />
<MudButton OnClick="@(() => _date = DateTime.Now)">Set Today</MudButton>
<MudButton OnClick="SetCurrentValues">Set Current Values</MudButton>
</MudStack>
</MudItem>
</MudGrid>

@code {
private MudDateTimePicker<DateTime?> _picker = null!;
private MudDateTimePicker<DateTime> _dateTimePicker = null!;
private MudDateTimePicker<DateTime?> _nullableDateTimePicker = null!;
private MudDateTimePicker<DateTimeOffset> _dateTimeOffsetPicker = null!;
private MudDateTimePicker<DateTimeOffset?> _nullableDateTimeOffsetPicker = null!;
private MudDateTimePicker<DateOnly> _dateOnlyPicker = null!;
private MudDateTimePicker<DateOnly?> _nullableDateOnlyPicker = null!;

private DateTime? _date = DateTime.Now;
private DateTime _dateTime = DateTime.Now;
private DateTime? _nullableDateTime;
private DateTimeOffset _dateTimeOffset = DateTimeOffset.UtcNow;
private DateTimeOffset? _nullableDateTimeOffset;
private DateOnly _dateOnly = DateOnly.FromDateTime(DateTime.Now);
private DateOnly? _nullableDateOnly;
private bool _editable = false;
private bool _showToolbar = true;
private bool _submitOnClose = true;
Expand All @@ -49,4 +106,16 @@
private bool _isAdornmentEnd = true;
private bool _clearable = false;
private Variant _variant = Variant.Outlined;

private void SetCurrentValues()
{
_dateTime = DateTime.Now;
_nullableDateTime = DateTime.Now;
_dateTimeOffset = DateTimeOffset.UtcNow;
_nullableDateTimeOffset = DateTimeOffset.UtcNow;
_dateOnly = DateOnly.FromDateTime(DateTime.Now);
_nullableDateOnly = DateOnly.FromDateTime(DateTime.Now);
}
}


Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@
<_Parameter1>CodeBeam.MudBlazor.Extensions.UnitTests</_Parameter1>
</AssemblyAttribute>
</ItemGroup>

<ItemGroup>
<None Include="Mud_Secondary.png">
<Pack>True</Pack>
Expand Down
Loading
Loading