Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[DatePicker] Add 'PickerMonthChanged' event and 'DaysTemplate' parameter #2336

Merged
merged 4 commits into from
Jul 8, 2024
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
Original file line number Diff line number Diff line change
Expand Up @@ -2644,6 +2644,21 @@
Gets or sets the design of this input.
</summary>
</member>
<member name="P:Microsoft.FluentUI.AspNetCore.Components.FluentDatePicker.OnCalendarOpen">
<summary>
raised when calendar popup opened
</summary>
</member>
<member name="P:Microsoft.FluentUI.AspNetCore.Components.FluentDatePicker.DaysTemplate">
<summary>
Defines the appearance of a Day cell.
</summary>
</member>
<member name="P:Microsoft.FluentUI.AspNetCore.Components.FluentDatePicker.PickerMonthChanged">
<summary>
Fired when the display month changes.
</summary>
</member>
<member name="P:Microsoft.FluentUI.AspNetCore.Components.FluentTimePicker.StyleValue">
<summary />
</member>
Expand Down
4 changes: 3 additions & 1 deletion src/Core/Components/DateTime/FluentDatePicker.razor
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@
DisabledDateFunc="@DisabledDateFunc"
DisabledSelectable="@DisabledSelectable"
Value="@Value"
ValueChanged="@OnSelectedDateAsync" />
ValueChanged="@OnSelectedDateAsync"
DaysTemplate="@DaysTemplate"
PickerMonthChanged="@PickerMonthChanged" />
</FluentAnchoredRegion>
}
15 changes: 15 additions & 0 deletions src/Core/Components/DateTime/FluentDatePicker.razor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,24 @@ protected override string? ClassValue
[Parameter]
public virtual FluentInputAppearance Appearance { get; set; } = FluentInputAppearance.Outline;

/// <summary>
/// raised when calendar popup opened
/// </summary>
[Parameter]
public EventCallback<bool> OnCalendarOpen { get; set; }

/// <summary>
/// Defines the appearance of a Day cell.
/// </summary>
[Parameter]
public RenderFragment<FluentCalendarDay>? DaysTemplate { get; set; }

/// <summary>
/// Fired when the display month changes.
/// </summary>
[Parameter]
public virtual EventCallback<DateTime> PickerMonthChanged { get; set; }

public bool Opened { get; set; } = false;

protected override string? FormatValueAsString(DateTime? value)
Expand Down
Loading