Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
73 commits
Select commit Hold shift + click to select a range
c0197de
feat(DateTimePicker):添加组件在移动端弹窗显示
Tony-ST0754 Nov 1, 2026
4cd22c0
revert:remove UseNativeMobileComponents parameter
Tony-ST0754 Nov 1, 2026
19222d6
feat(Modal):add Zindex Parameter
Tony-ST0754 Nov 1, 2026
6765130
refactor:取消 js 中控制弹窗层级的逻辑,增加 ModalZIndex 参数控制
Tony-ST0754 Nov 1, 2026
9377311
Merge branch 'main' into dev-DateTimePicker-mobile
Tony-ST0754 Nov 2, 2026
4fc90d9
refactor(DateTimePicker):重构移动端弹窗侧边栏显示
Tony-ST0754 Nov 2, 2026
91d90a9
test:补充单元测试
Tony-ST0754 Nov 2, 2026
0624fa3
feat(DateTimeRange):适配移动端弹窗模式
Tony-ST0754 Nov 2, 2026
7dbab4f
test:补充单元测试
Tony-ST0754 Nov 2, 2026
a8e4add
feat:补充在未选择开始时间时,确定按钮不可用
Tony-ST0754 Nov 2, 2026
beeeda5
Merge branch 'main' into dev-DateTimePicker-mobile
ArgoZhang Nov 3, 2026
abb7e8c
revert: 恢复代码方便 review
ArgoZhang Nov 3, 2026
9cee96a
doc: 更新 Size 组件
ArgoZhang Nov 4, 2026
8a62f0b
refactor: 增加 Dialog 客户端脚本
ArgoZhang Nov 4, 2026
5d9548d
doc: 更新文档
ArgoZhang Nov 4, 2026
50d7bea
feat: 视口变化时调用 reset 客户端方法
ArgoZhang Nov 4, 2026
1405306
refactor: 增加 data-bb-dialog 状态
ArgoZhang Nov 4, 2026
7ee7146
refactor: 根据 DialogModeString 渲染 UI
ArgoZhang Nov 4, 2026
9e720bf
feat: 重构 Picker 脚本视口改变由客户端完成
ArgoZhang Nov 4, 2026
ff1f732
refactor: 更新示例
ArgoZhang Nov 4, 2026
92c9948
chore: 更新示例多语言
ArgoZhang Nov 4, 2026
3042d09
chore: 增加组件多语言
ArgoZhang Nov 4, 2026
691d3bd
feat:本次打开保持原样,下次打开采用新布局,避免旋转或展开屏幕打断日期选择
Tony-ST0754 Nov 5, 2026
0aa5bd3
refactor: `popover`模式的本次打开保持原样,下次打开采用新布局,重新调整逻辑结构
Tony-ST0754 Nov 5, 2026
ded9202
refactor: 更改样式名称
ArgoZhang Nov 5, 2026
c5f5520
refactor: Body 组件移除 ShowSidebar 参数统一由容器组件提供
ArgoZhang Nov 5, 2026
eaadcc5
refactor: 更改样式名称
ArgoZhang Nov 5, 2026
72f53a9
refactor: 移除 ShowSider 参数
ArgoZhang Nov 5, 2026
72eff07
feat: 完善 Clock 渲染逻辑
ArgoZhang Nov 5, 2026
b8fe6b7
test: 更新单元测试
ArgoZhang Nov 5, 2026
0a798da
doc: 更新示例
ArgoZhang Nov 5, 2026
9cbddab
refactor: 调整 Range 组件(临时提交)
ArgoZhang Nov 5, 2026
0d84970
fix(GoTop): use parentElement property (#8647)
Tony-ST0754 Oct 31, 2026
bae72ca
feat(AutoGenerateColumn): add Required property (#8643)
Tony-ST0754 Oct 31, 2026
53386e6
chore(AIAgents): add dev/review/test AI agents (#8653)
ArgoZhang Nov 1, 2026
f2c02ce
doc(Table): update edit sample add Required comments (#8651)
Tony-ST0754 Nov 1, 2026
1ac908d
chore(Agent): update AGENT.md (#8657)
ArgoZhang Nov 1, 2026
e2bcdaa
feat(ValidateForm): add EnableFieldValueChanged parameter (#8655)
ArgoZhang Nov 1, 2026
7fcc34f
fix(Calendar): honour FirstDayOfWeek for the month start and the week…
rabauss Nov 2, 2026
6764410
chore(AIAgents): update browser and review guidance (#8661)
ArgoZhang Nov 2, 2026
1d47d2d
revert(ValidateForm): add EnableFieldValueChanged parameter (#8665)
ArgoZhang Nov 2, 2026
e1eeba1
chore(AIAgents): update agents avoid conflict (#8667)
ArgoZhang Nov 3, 2026
33823ce
feat(Dom2Image): update SnapDOM to v3.7.1 (#8669)
ArgoZhang Nov 4, 2026
9e29c94
feat(ColorPicker): bump pickr version 1.10.3 (#8671)
ArgoZhang Nov 4, 2026
d3fb08a
doc(DateTimePicker): update IsButton/PickTimeMode sample (#8673)
ArgoZhang Nov 5, 2026
83ba7c7
doc(Table): update OnCellRender sample (#8675)
ArgoZhang Nov 5, 2026
303704c
Merge branch 'main' into dev-picker-try
ArgoZhang Nov 5, 2026
d29b9db
doc: 更新过期标志
ArgoZhang Nov 5, 2026
dc4a7ee
feat: 增加 DateTimePickerSidebarItem 行为与 Range 一致
ArgoZhang Nov 5, 2026
3038777
refactor: 删除不使用的代码
ArgoZhang Nov 5, 2026
6b92d1d
feat: 增加侧边栏功能
ArgoZhang Nov 5, 2026
6a1e634
feat: 增加 SidebarTemplate 功能
ArgoZhang Nov 5, 2026
70ec8cc
doc: 更新示例
ArgoZhang Nov 5, 2026
9bdac03
chore: 移除 side 样式
ArgoZhang Nov 5, 2026
7f6da85
chore: 清理冗余本地化键值
ArgoZhang Nov 5, 2026
af9a1a6
chore: 更新其他本地化
ArgoZhang Nov 5, 2026
bbb1d22
chore: 增加本地化规测
ArgoZhang Nov 5, 2026
d588cc7
chore: 更新样式
ArgoZhang Nov 5, 2026
8c82b31
doc: 更新示例
ArgoZhang Nov 5, 2026
636b19e
Merge branch 'dev-picker-try' into dev-DateTimePicker-mobile
ArgoZhang Nov 5, 2026
fbd1447
refactor: 撤销冗余代码
ArgoZhang Nov 5, 2026
67e1d52
style: 更新样式
ArgoZhang Nov 5, 2026
643d6de
doc: 更新示例
ArgoZhang Nov 5, 2026
c4b42e0
style: 调整样式适配新模式
ArgoZhang Nov 5, 2026
fec9dad
doc: 更新示例
ArgoZhang Nov 5, 2026
c3d6035
chore: 精简样式
ArgoZhang Nov 5, 2026
b4e6de7
refactor: 与 Picker 组件统一结构
ArgoZhang Nov 5, 2026
60e74d0
refactor: 移除 data-bb-dropdown 属性
ArgoZhang Nov 5, 2026
7db1644
style: 最大化复用 Picker 样式
ArgoZhang Nov 5, 2026
d0c7a8b
chore: 调整样式
ArgoZhang Nov 5, 2026
5202a61
refactor: 撤销不需要的更改
ArgoZhang Nov 5, 2026
1824bac
revert: 撤销更改
ArgoZhang Nov 5, 2026
d6ab905
Merge branch 'main' into dev-DateTimePicker-mobile
ArgoZhang Nov 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
1 change: 1 addition & 0 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@

- 所有用户可见文本必须使用 `IStringLocalizer`
- 禁止硬编码中文/英文 UI 文本
- 本地化文件使用 json 文件存储在 localization 文件夹与相应项目 Locales 目录下

---

Expand Down
5 changes: 1 addition & 4 deletions localization/de.json
Original file line number Diff line number Diff line change
Expand Up @@ -56,10 +56,7 @@
"Months": "Jan,Feb,Mär,Apr,Mai,Jun,Jul,Aug,Sep,Okt,Nov,Dez",
"MonthLists": "Jan,Feb,Mär,Apr,Mai,Jun,Jul,Aug,Sep,Okt,Nov,Dez",
"WeekLists": "So,Mo,Di,Mi,Do,Fr,Sa",
"GenericTypeErrorMessage": "DateTimePicker unterstützt nur DateTime, DateTime?, DateTimeOffset, DateTimeOffset?",
"Today": "Heute",
"Yesterday": "Gestern",
"Week": "Vor einer Woche"
"GenericTypeErrorMessage": "DateTimePicker unterstützt nur DateTime, DateTime?, DateTimeOffset, DateTimeOffset?"
},
"BootstrapBlazor.Components.DateTimeRange": {
"SeparateText": "Bis",
Expand Down
5 changes: 1 addition & 4 deletions localization/es.json
Original file line number Diff line number Diff line change
Expand Up @@ -56,10 +56,7 @@
"Months": "Ene,Feb,Mar,Abr,May,Jun,Jul,Ago,Sep,Oct,Nov,Dic",
"MonthLists": "Ene,Feb,Mar,Abr,May,Jun,Jul,Ago,Sep,Oct,Nov,Dic",
"WeekLists": "Dom,Lun,Mar,Mié,Jue,Vie,Sáb",
"GenericTypeErrorMessage": "DateTimePicker solo soporta DateTime, DateTime?, DateTimeOffset, DateTimeOffset?",
"Today": "Hoy",
"Yesterday": "Ayer",
"Week": "Hace una semana"
"GenericTypeErrorMessage": "DateTimePicker solo soporta DateTime, DateTime?, DateTimeOffset, DateTimeOffset?"
},
"BootstrapBlazor.Components.DateTimeRange": {
"SeparateText": "A",
Expand Down
5 changes: 1 addition & 4 deletions localization/it.json
Original file line number Diff line number Diff line change
Expand Up @@ -56,10 +56,7 @@
"Months": "Gennaio,Febbraio,Marzo,Aprile,Maggio,Giugno,Luglio,Agosto,Settembre,Ottobre,Novembre,Dicembre",
"MonthLists": "Gen,Feb,Mar,Apr,Mag,Giu,Lug,Ago,Set,Ott,Nov,Dic",
"WeekLists": "Dom,Lun,Mar,Mer,Gio,Ven,Sab",
"GenericTypeErrorMessage": "DateTimePicker supporta solo DateTime o Nullable<DateTime>",
"Today": "Oggi",
"Yesterday": "Ieri",
"Week": "Una settimana fa"
"GenericTypeErrorMessage": "DateTimePicker supporta solo DateTime o Nullable<DateTime>"
},
"BootstrapBlazor.Components.DateTimeRange": {
"SeparateText": "A",
Expand Down
5 changes: 1 addition & 4 deletions localization/km-KH.json
Original file line number Diff line number Diff line change
Expand Up @@ -56,10 +56,7 @@
"Months": "មករា,កុម្ភៈ,មីនា,មេសា,ឧសភា,មិថុនា,កក្កដា,សីហា,កញ្ញា,តុលា,វិច្ឆិកា,ធ្នូ",
"MonthLists": "មករា,កុម្ភៈ,មីនា,មេសា,ឧសភា,មិថុនា,កក្កដា,សីហា,កញ្ញា,តុលា,វិច្ឆិកា,ធ្នូ",
"WeekLists": "អាទិត្យ,ចន្ទ,អង្គារ,ពុធ,ព្រហស្បតិ៍,សុក្រ,សៅរ៍",
"GenericTypeErrorMessage": "DateTimePicker ដំណើរការតែ DateTime, DateTime?, DateTimeOffset និង DateTimeOffset? ប៉ុណ្ណោះ",
"Today": "ថ្ងៃនេះ",
"Yesterday": "ម្សិលមិញ",
"Week": "មួយ​សប្តាហ៍​មុន"
"GenericTypeErrorMessage": "DateTimePicker ដំណើរការតែ DateTime, DateTime?, DateTimeOffset និង DateTimeOffset? ប៉ុណ្ណោះ"
},
"BootstrapBlazor.Components.DateTimeRange": {
"SeparateText": "ដល់",
Expand Down
5 changes: 1 addition & 4 deletions localization/pt-BR.json
Original file line number Diff line number Diff line change
Expand Up @@ -56,10 +56,7 @@
"Months": "Jan,Fev,Mar,Abr,Mai,Jun,Jul,Ago,Set,Out,Nov,Dez",
"MonthLists": "Jan,Fev,Mar,Abr,Mai,Jun,Jul,Ago,Set,Out,Nov,Dez",
"WeekLists": "Dom,Seg,Ter,Qua,Qui,Sex,Sáb",
"GenericTypeErrorMessage": "DateTimePicker só suporta DateTime DateTime? DateTimeOffset DateTimeOffset?",
"Today": "Hoje",
"Yesterday": "Ontem",
"Week": "Há uma semana"
"GenericTypeErrorMessage": "DateTimePicker só suporta DateTime DateTime? DateTimeOffset DateTimeOffset?"
},
"BootstrapBlazor.Components.DateTimeRange": {
"SeparateText": "Até",
Expand Down
5 changes: 1 addition & 4 deletions localization/pt.json
Original file line number Diff line number Diff line change
Expand Up @@ -56,10 +56,7 @@
"Months": "Jan,Fev,Mar,Abr,Mai,Jun,Jul,Ago,Set,Out,Nov,Dez",
"MonthLists": "Jan,Fev,Mar,Abr,Mai,Jun,Jul,Ago,Set,Out,Nov,Dez",
"WeekLists": "Dom,Seg,Ter,Qua,Qui,Sex,Sáb",
"GenericTypeErrorMessage": "DateTimePicker suporta apenas DateTime, DateTime?, DateTimeOffset, DateTimeOffset?",
"Today": "Hoje",
"Yesterday": "Ontem",
"Week": "Uma semana atrás"
"GenericTypeErrorMessage": "DateTimePicker suporta apenas DateTime, DateTime?, DateTimeOffset, DateTimeOffset?"
},
"BootstrapBlazor.Components.DateTimeRange": {
"SeparateText": "Até",
Expand Down
5 changes: 1 addition & 4 deletions localization/ru-RU.json
Original file line number Diff line number Diff line change
Expand Up @@ -56,10 +56,7 @@
"Months": "Янв,Фев,Мар,Апр,Май,Июн,Июл,Авг,Сен,Окт,Ноя,Дек",
"MonthLists": "Янв,Фев,Мар,Апр,Май,Июн,Июл,Авг,Сен,Окт,Ноя,Дек",
"WeekLists": "Вс,Пн,Вт,Ср,Чт,Пт,Сб",
"GenericTypeErrorMessage": "DateTimePicker поддерживает только DateTime, DateTime?, DateTimeOffset, DateTimeOffset?",
"Today": "Сегодня",
"Yesterday": "Вчера",
"Week": "Неделю назад"
"GenericTypeErrorMessage": "DateTimePicker поддерживает только DateTime, DateTime?, DateTimeOffset, DateTimeOffset?"
},
"BootstrapBlazor.Components.DateTimeRange": {
"SeparateText": "До",
Expand Down
5 changes: 1 addition & 4 deletions localization/th-TH.json
Original file line number Diff line number Diff line change
Expand Up @@ -56,10 +56,7 @@
"Months": "ม.ค.,ก.พ.,มี.ค.,เม.ย.,พ.ค.,มิ.ย.,ก.ค.,ส.ค.,ก.ย.,ต.ค.,พ.ย.,ธ.ค.",
"MonthLists": "ม.ค.,ก.พ.,มี.ค.,เม.ย.,พ.ค.,มิ.ย.,ก.ค.,ส.ค.,ก.ย.,ต.ค.,พ.ย.,ธ.ค.",
"WeekLists": "อา,จ,อ,พ,พฤ,ศ,ส",
"GenericTypeErrorMessage": "DateTimePicker รองรับเฉพาะ DateTime, DateTime?, DateTimeOffset, DateTimeOffset?",
"Today": "วันนี้",
"Yesterday": "เมื่อวาน",
"Week": "หนึ่งสัปดาห์ก่อน"
"GenericTypeErrorMessage": "DateTimePicker รองรับเฉพาะ DateTime, DateTime?, DateTimeOffset, DateTimeOffset?"
},
"BootstrapBlazor.Components.DateTimeRange": {
"SeparateText": "ถึง",
Expand Down
5 changes: 1 addition & 4 deletions localization/uk-UA.json
Original file line number Diff line number Diff line change
Expand Up @@ -56,10 +56,7 @@
"Months": "Січ,Лют,Бер,Квіт,Трав,Черв,Лип,Серп,Вер,Жовт,Лист,Груд",
"MonthLists": "Січ,Лют,Бер,Квіт,Трав,Черв,Лип,Серп,Вер,Жовт,Лист,Груд",
"WeekLists": "Нд,Пн,Вт,Ср,Чт,Пт,Сб",
"GenericTypeErrorMessage": "DateTimePicker підтримує лише DateTime, DateTime?, DateTimeOffset, DateTimeOffset?",
"Today": "Сьогодні",
"Yesterday": "Вчора",
"Week": "Тиждень тому"
"GenericTypeErrorMessage": "DateTimePicker підтримує лише DateTime, DateTime?, DateTimeOffset, DateTimeOffset?"
},
"BootstrapBlazor.Components.DateTimeRange": {
"SeparateText": "До",
Expand Down
5 changes: 1 addition & 4 deletions localization/zh-TW.json
Original file line number Diff line number Diff line change
Expand Up @@ -56,10 +56,7 @@
"Months": "1,2,3,4,5,6,7,8,9,10,11,12",
"MonthLists": "一月,二月,三月,四月,五月,六月,七月,八月,九月,十月,十一月,十二月",
"WeekLists": "日,一,二,三,四,五,六",
"GenericTypeErrorMessage": "DateTimePicker 元件僅支援綁定泛型為 DateTime DateTime? DateTimeOffset DateTimeOffset?",
"Today": "今天",
"Yesterday": "昨天",
"Week": "一週前"
"GenericTypeErrorMessage": "DateTimePicker 元件僅支援綁定泛型為 DateTime DateTime? DateTimeOffset DateTimeOffset?"
},
"BootstrapBlazor.Components.DateTimeRange": {
"SeparateText": "至",
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
@inject IStringLocalizer<BootstrapBlazor.Server.Components.Samples.DateTimePickers> Localizer

<ValidateForm Model="this" OnValidSubmit="OnValidSubmitAsync">
<div class="row g-3">
<div class="col-12">
<DateTimePicker @bind-Value="DateValue" DisplayText="@Localizer["NestedDateLabel"]" />
</div>
<div class="col-12">
<DateTimePicker @bind-Value="SidebarDateValue" DisplayText="@Localizer["NestedDateLabel"]"
ShowSidebar="true">
<SidebarTemplate Context="selectDate">
<div class="sidebar-item" @onclick="() => selectDate(DateTime.Today.AddDays(1 - DateTime.Today.Day))">
<i class="fa-fw fa-solid fa-home"></i>
<span>@Localizer["SidebarMonthStart"]</span>
</div>
<div class="sidebar-item" @onclick="() => selectDate(DateTime.Today.AddDays(1 - DateTime.Today.Day))">
<i class="fa-fw fa-solid fa-home"></i>
<span>@Localizer["SidebarMonthStart"]</span>
</div>
<div class="sidebar-item" @onclick="() => selectDate(DateTime.Today.AddDays(1 - DateTime.Today.Day))">
<i class="fa-fw fa-solid fa-home"></i>
<span>@Localizer["SidebarMonthStart"]</span>
</div>
<div class="sidebar-item" @onclick="() => selectDate(DateTime.Today.AddDays(1 - DateTime.Today.Day))">
<i class="fa-fw fa-solid fa-home"></i>
<span>@Localizer["SidebarMonthStart"]</span>
</div>
<div class="sidebar-item" @onclick="() => selectDate(DateTime.Today.AddDays(1 - DateTime.Today.Day))">
<i class="fa-fw fa-solid fa-home"></i>
<span>@Localizer["SidebarMonthStart"]</span>
</div>
<div class="sidebar-item" @onclick="() => selectDate(DateTime.Today.AddDays(1 - DateTime.Today.Day))">
<i class="fa-fw fa-solid fa-home"></i>
<span>@Localizer["SidebarMonthStart"]</span>
</div>
</SidebarTemplate>
</DateTimePicker>
</div>
<div class="col-12">
<DateTimePicker @bind-Value="DateTimeValue" ViewMode="DatePickerViewMode.DateTime"
PickTimeMode="PickTimeMode.Clock" DisplayText="@Localizer["NestedDateTimeLabel"]" />
</div>
<div class="col-12">
<DateTimeRange @bind-Value="RangeValue" ShowSidebar="true" DisplayText="@Localizer["NestedRangeLabel"]" />
</div>
<div class="col-12">
<Button ButtonType="ButtonType.Submit" Text="@Localizer["SubmitText"]" />
</div>
</div>
@if (_submitted)
{
<div class="mt-3" role="status">@Localizer["NestedSubmitted"]</div>
}
<div class="mt-3">
<output>@DateValue?.ToString("yyyy-MM-dd")</output>
<output class="d-block">@DateTimeValue?.ToString("yyyy-MM-dd HH:mm:ss")</output>
<output class="d-block">@RangeValue.Start.ToString("yyyy-MM-dd") — @RangeValue.End.ToString("yyyy-MM-dd")</output>
</div>
</ValidateForm>

@code {
/// <summary>
/// <para lang="zh">获得/设置 表单日期。</para>
/// <para lang="en">Gets or sets the form date.</para>
/// </summary>
[Required]
public DateTime? DateValue { get; set; }

/// <summary>
/// <para lang="zh">获得/设置 自定义侧边栏日期。</para>
/// <para lang="en">Gets or sets the custom sidebar date.</para>
/// </summary>
public DateTime? SidebarDateValue { get; set; }

/// <summary>
/// <para lang="zh">获得/设置 表单日期时间。</para>
/// <para lang="en">Gets or sets the form date and time.</para>
/// </summary>
public DateTime? DateTimeValue { get; set; } = DateTime.Now;

/// <summary>
/// <para lang="zh">获得/设置 表单日期范围。</para>
/// <para lang="en">Gets or sets the form date range.</para>
/// </summary>
public DateTimeRangeValue RangeValue { get; set; } = new();

private bool _submitted;

private Task OnValidSubmitAsync(EditContext context)
{
_submitted = true;
return Task.CompletedTask;
}
}
Original file line number Diff line number Diff line change
@@ -1,9 +1,14 @@
@page "/datetime-picker"
@page "/datetime-picker/dialog"

<h3>@Localizer["Title"]</h3>

<h4>@Localizer["Description"]</h4>

<DemoBlock Title="@Localizer["NestedDialogTitle"]" Introduction="@Localizer["NestedDialogIntro"]" Name="NestedDialog">
<Button Text="@Localizer["NestedDialogOpen"]" OnClick="ShowNestedDialogAsync" />
</DemoBlock>

<DemoBlock Title="@Localizer["DateTimePickerTitle"]" Introduction="@Localizer["DateTimePickerIntro"]" Name="DateTimePicker">
<section ignore>
<p>@Localizer["DateTimePickerParameters"]</p>
Expand Down Expand Up @@ -185,7 +190,15 @@
</DemoBlock>

<DemoBlock Title="@Localizer["ShowSidebarTitle"]" Introduction="@Localizer["ShowSidebarIntro"]" Name="ShowSidebar">
<DateTimePicker ShowSidebar="true" @bind-Value="SidebarValue" />
<DateTimePicker ShowSidebar="true" SidebarItems="_sidebarItems" @bind-Value="CustomSidebarValue" />
<DateTimePicker class="mt-3" ShowSidebar="true" @bind-Value="SidebarValue">
<SidebarTemplate Context="selectDate">
<div class="sidebar-item" @onclick="() => selectDate(DateTime.Today.AddDays(1 - DateTime.Today.Day))">
<i class="fa-fw fa-solid fa-home"></i>
<span>@Localizer["SidebarMonthStart"]</span>
</div>
</SidebarTemplate>
</DateTimePicker>
</DemoBlock>

<DemoBlock Title="@Localizer["MinValueTitle"]" Introduction="@Localizer["MinValueIntro"]" Name="MinValue">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,17 @@ namespace BootstrapBlazor.Server.Components.Samples;
/// </summary>
public sealed partial class DateTimePickers
{
[Inject]
[NotNull]
private DialogService? DialogService { get; set; }

private Task ShowNestedDialogAsync() => DialogService.Show(new DialogOption
{
Title = Localizer["NestedDialogTitle"],
Component = BootstrapDynamicComponent.CreateComponent<DatePickerDialogForm>(),
ShowFooter = false
});

private DateTime DateTimePickerValue { get; set; }

[NotNull]
Expand Down Expand Up @@ -50,6 +61,15 @@ private Task NormalOnConfirm()

private DateTime SidebarValue { get; set; } = DateTime.Today;

private DateTime CustomSidebarValue { get; set; } = DateTime.Today;

private readonly List<DateTimePickerSidebarItem> _sidebarItems =
[
new() { Text = DateTime.Today.AddDays(-1).ToString("yyyy-MM-dd"), Value = DateTime.Today.AddDays(-1) },
new() { Text = DateTime.Today.AddDays(1).ToString("yyyy-MM-dd"), Value = DateTime.Today.AddDays(1) },
new() { Text = DateTime.Today.AddDays(7).ToString("yyyy-MM-dd"), Value = DateTime.Today.AddDays(7) }
];

private DateTime YearValue { get; set; } = DateTime.Today;

private DateTime MonthValue { get; set; } = DateTime.Today;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@

<h4>@Localizer["Description"]</h4>

<DemoBlock Title="@Localizer["ResponsiveTitle"]" Introduction="@Localizer["ResponsiveIntro"]" Name="Responsive">
<DateTimeRange Value="@TodayDateTimeRangeValue" ShowSidebar="true" ShowToday="true" RenderMode="DateTimeRangeRenderMode.Double" />
</DemoBlock>

<DemoBlock Title="@Localizer["NormalTitle"]" Introduction="@Localizer["NormalIntro"]" Name="Normal">
<DateTimeRange @bind-Value="@NormalDateTimeRangeValue" OnConfirm="OnNormalConfirm" ShowSidebar="true" ViewMode="DatePickerViewMode.Year" IsEditable="true" DateFormat="yyyy">
<TimePickerSetting ShowClockScale="true" IsAutoSwitch="false" />
Expand Down
14 changes: 12 additions & 2 deletions src/BootstrapBlazor.Server/Locales/en-US.json
Original file line number Diff line number Diff line change
Expand Up @@ -1716,6 +1716,13 @@
"Title": "CountUp"
},
"BootstrapBlazor.Server.Components.Samples.DateTimePickers": {
"NestedDialogTitle": "Pickers in a nested dialog form",
"NestedDialogIntro": "Open the form, then its date or date/time picker. The client checks the viewport directly: below 768px it uses a native dialog; at 768px and above it keeps the existing Popover, without a Responsive component. Crossing the breakpoint closes the current panel and switches modes for the next open. Check that closing the picker returns to the editable form, required validation and submission work, and reopening does not create duplicate dialogs. Also check confirming and canceling the built-in time picker. The outer form uses DialogService; the date picker itself does not require a Dialog host.",
"NestedDialogOpen": "Open form dialog",
"NestedDateLabel": "Required date",
"NestedDateTimeLabel": "Date and time (with nested time picker)",
"NestedRangeLabel": "Date range",
"NestedSubmitted": "Form validation and submission succeeded.",
"BindValueIntro": "The values in the text box change as the date component time changes",
"BindValueTitle": "Data is bound in both directions",
"BlockAutoCloseDesc": "<code>AutoClose</code> The default value is <code>true</code> When selecting a date, the pop-up window will automatically close. When the value is set to <code>false</code>, the pop-up window needs to be closed when the <b>confirm</b> button is clicked",
Expand Down Expand Up @@ -1779,7 +1786,8 @@
"ShowLabelIntro": "When you are a form component, the label in front of the component is displayed",
"ShowLabelTip": "Set the <code>DisplayText</code> property value to <code>select time</code>, The pre-label explicit rules are consistent with the <code>BootstrapInput</code> component of the <a href='input'>[portal]</a>",
"ShowLabelTitle": "The label is displayed",
"ShowSidebarIntro": "When you set the <code>ShowSidebar</code> property value to <code>true</code>, the component displays the shortcut sidebar",
"ShowSidebarIntro": "Set <code>ShowSidebar=\"true\"</code> to show the sidebar and configure shortcuts with <code>SidebarItems</code>. The second example uses <code>SidebarTemplate</code> for a custom first-day-of-month button. Its context is a date selection callback that checks date bounds and disabled dates. The sidebar works in both desktop Popover and mobile Dialog modes.",
"SidebarMonthStart": "First day of this month",
"ShowSidebarTitle": "Sidebar with shortcuts",
"SubmitText": "Save",
"Title": "DatePicker",
Expand All @@ -1805,11 +1813,13 @@
"Limit": "time limit",
"MaxMinValueIntro": "set time range",
"MaxMinValueTitle": "Max and Min",
"NormalIntro": "Take 'day' as the basic unit, select a period of time",
"NormalIntro": "Select a date range in days. On small screens, a single-panel dialog is used with Clear, Today and OK actions in its footer. After selecting only the start date, use Reselect in the header to choose the start date again",
"NormalTitle": "Basic skills",
"SidebarIntro": "When the <code>ShowSidebar</code> property value is set to <code>true</code>, the component displays the shortcut sidebar",
"SidebarTip": "by setting <code>ShowSidebar</code> The parameter enables the display sidebar shortcut options function, by setting <code>SidebarItems</code> The parameter collection replaces the default shortcuts built into the component",
"SidebarTitle": "Sidebar with shortcut keys",
"ResponsiveTitle": "Responsive dialog",
"ResponsiveIntro": "Below 768px, a native dialog always shows one calendar with navigation to select a date range. At 768px and above, a Popover follows RenderMode for single or double view. Crossing the breakpoint closes the panel; reopen it to use the new mode. The date picker's nested form example also demonstrates range selection inside a dialog.",
"SingleViewTitle": "Single view mode",
"Submit": "Submit",
"Title": "Date Time Range Picker",
Expand Down
Loading
Loading