Skip to content

Commit

Permalink
[DatePicker] Add 'PickerMonthChanged' event and 'DaysTemplate' parame…
Browse files Browse the repository at this point in the history
…ter (#2336)

* add 'PickerMonthChanged' event and 'DaysTemplate' property to date picker

* add xml document for properties

* change type of DaysTemplate of FluentDatePicker to nullable
  • Loading branch information
ehsangfl authored Jul 8, 2024
1 parent 49d7a18 commit ac91e57
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 1 deletion.
15 changes: 15 additions & 0 deletions examples/Demo/Shared/Microsoft.FluentUI.AspNetCore.Components.xml
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

0 comments on commit ac91e57

Please sign in to comment.