Skip to content

Commit

Permalink
🐛 fix(DatePicker): Incorrect year value when Locale="fa-IR" (#2099)
Browse files Browse the repository at this point in the history
  • Loading branch information
capdiem authored Aug 12, 2024
1 parent c0d6b2c commit 39193ec
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/Masa.Blazor/Components/DatePicker/MDatePicker.razor
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@
Min="@MinYear"
Max="@MaxYear"
Value="@TableYear"
TableDate="@TableDate"
Locale="@CurrentLocale"
Type="@Type"
OnInput="@OnYearClickAsync"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
class="@GetClass(CssClassUtils.GetTextColor(color), active ? "active" : null)"
style="@(StyleBuilder.Create().AddTextColor(color))"
@onclick="@(() => HandleOnYearItemClickAsync(year))">
@Formatter(new DateOnly(year, 1, 1))
@Formatter(new DateOnly(year, TableDate.Month, TableDate.Day))
</li>
};
}
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@ public partial class MDatePickerYears : MasaComponentBase

[Parameter] public int Value { get; set; }

// for issue #2097
[Parameter] public DateOnly TableDate { get; set; }

[Parameter] public EventCallback<int> OnInput { get; set; }

[Parameter] public EventCallback<int> OnYearClick { get; set; }
Expand Down

0 comments on commit 39193ec

Please sign in to comment.