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
Original file line number Diff line number Diff line change
Expand Up @@ -2931,6 +2931,12 @@
Gets or sets a value which will be set when double-clicking on the text field of date picker.
</summary>
</member>
<member name="P:Microsoft.FluentUI.AspNetCore.Components.FluentDatePicker.PopupHorizontalPosition">
<summary>
Gets or sets an <see cref="T:Microsoft.FluentUI.AspNetCore.Components.HorizontalPosition"/> for the popup displayed when the user open the calendar.
By default, this value is Left or Right, depending of the 'CurrentUICulture.TextInfo.IsRightToLeft' value.
</summary>
</member>
<member name="P:Microsoft.FluentUI.AspNetCore.Components.FluentTimePicker.StyleValue">
<summary />
</member>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
<FluentDatePicker Label="Months view" AriaLabel="To" @bind-Value="@SelectedValue" View="CalendarViews.Months" DoubleClickToDate="@DoubleClickToDate" />
</div>
<div>
<FluentDatePicker Label="Years view" AriaLabel="To" @bind-Value="@SelectedValue" View="CalendarViews.Years" DoubleClickToDate="@DoubleClickToDate" />
<FluentDatePicker Label="Years view" AriaLabel="To" @bind-Value="@SelectedValue" View="CalendarViews.Years" DoubleClickToDate="@DoubleClickToDate" PopupHorizontalPosition="@HorizontalPosition.Left" />
</div>
</div>
<p>
Expand Down
2 changes: 1 addition & 1 deletion src/Core/Components/DateTime/FluentDatePicker.razor
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
<FluentOverlay @bind-Visible="@Opened" Dismissable="true" FullScreen="true" Interactive="true" InteractiveExceptId="@PopupId" />
<FluentAnchoredRegion Anchor="@Id"
Id="@PopupId"
HorizontalDefaultPosition="@(System.Globalization.CultureInfo.CurrentUICulture.TextInfo.IsRightToLeft ? HorizontalPosition.Left : HorizontalPosition.Right)"
HorizontalDefaultPosition="@(PopupHorizontalPosition ?? (System.Globalization.CultureInfo.CurrentUICulture.TextInfo.IsRightToLeft ? HorizontalPosition.Left : HorizontalPosition.Right))"
HorizontalInset="true"
VerticalDefaultPosition="@VerticalPosition.Unset"
Shadow="ElevationShadow.Flyout"
Expand Down
7 changes: 7 additions & 0 deletions src/Core/Components/DateTime/FluentDatePicker.razor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,13 @@ protected override string? ClassValue
[Parameter]
public DateTime? DoubleClickToDate { get; set; }

/// <summary>
/// Gets or sets an <see cref="HorizontalPosition"/> for the popup displayed when the user open the calendar.
/// By default, this value is Left or Right, depending of the 'CurrentUICulture.TextInfo.IsRightToLeft' value.
/// </summary>
[Parameter]
public HorizontalPosition? PopupHorizontalPosition { get; set; }

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

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