logo
为了能更好地了解您的商业使用需求,请参与 Ant Design Blazor 商业应用调查,一起建设商业应用社区,为企业系统研发赋能!

Calendar日历

Examples

一个通用的日历面板,支持年/月切换。

expand code expand code

一个复杂的应用示例,用 dateCellRendermonthCellRender 函数来自定义需要渲染的数据。

expand code expand code

用于嵌套在空间有限的容器中。

expand code expand code

一个通用的日历面板,支持年/月切换。

expand code expand code

自定义日历头部内容。

expand code expand code

Calendar API#

属性 描述 类型 默认值
Value 属性日历的选定值 DateTime DateTime.Now
DefaultValue 属性所选日期的默认值。设置时,将设置 AntDesign.Calendar.Value DateTime --
ValidRange 属性验证日期范围或选择 DateTime[] --
Mode 属性显示模式。请参阅 CalendarMode 了解有效选项 CalendarMode CalendarMode.Month
FullScreen 属性日历是否应占用所有可用空间 Boolean true
OnSelect 属性选择日期时执行的回调请改用 OnChange

Obsolete 将在未来的版本中删除。
EventCallback<DateTime> --
OnChange 属性选择日期时执行的回调 EventCallback<DateTime> --
HeaderRender 属性呈现自定义标头的函数 Func<CalendarHeaderRenderArgs, RenderFragment> --
DateCellRender 属性自定义日期单元格的显示,返回的内容会追加到单元格中 Func<DateTime, RenderFragment> --
DateFullCellRender 属性自定义日期单元格的显示,返回的内容会覆盖单元格 Func<DateTime, RenderFragment> --
MonthCellRender 属性自定义月份单元格的显示,返回的内容会追加到单元格中 Func<DateTime, RenderFragment> --
MonthFullCellRender 属性自定义月份单元格的显示,返回内容会覆盖单元格 Func<DateTime, RenderFragment> --
OnPanelChange 属性当正在查看的日历类型发生变化时执行的回调 Action<DateTime, String> --
DisabledDate 属性确定特定日期是否被禁用的函数 Func<DateTime, Boolean> --
Locale 属性UI 和日期格式的语言环境信息 DatePickerLocale --
CultureInfo 属性用于格式化的文化信息 CultureInfo --
Id 属性组件 HTML 的 ID String Uniquely Generated ID
Class 属性为 DOM 元素指定一个或多个类名。 String --
Style 属性指定 DOM 元素的内联样式。 String --
RefBack 属性一个 ForwardRef 实例。您可以使用 AntDesign.ForwardRef.Current 获取对内部 DOM 的引用。 ForwardRef --
方法签名 返回类型 描述
ChangePickerType(DatePickerType type, Int32 index) void
ChangePickerType(DatePickerType type) void
Badge徽标数 Card卡片
文档已更新,请点击 此处 更新。
A new version of this app is available. Click here to update.