v0.1.0-alpha
官网Home
components/calendar
数据展示Display · 32 / 64

Calendar

ui.widgets.Calendar

月视图日期浏览与选择。Month-view date browsing and selection.

BEHAVIOR CONTRACT

月份计算、首周偏移、选中日和导航按钮共享 SimpleDate 模型。Month math, first-week offset, selection and navigation share the SimpleDate model.

RECORDED INTERACTION

Harness 点击 18 日,选中态随之移动。The harness clicks the 18th and the selection moves.

examples/storybook/stories.zig:2457
// ── Calendar ──
pub fn buildCalendar(scope: *ui.Scope, cx: *ui.Cx) anyerror!*ui.Node {
    const cal = try W.Calendar(.{ .initial_year = 2026, .initial_month = 5 }).mount(scope, cx);
    return cal.wrapper;
}
在 GitHub 查看源码View source on GitHubexamples/storybook/stories.zig:2457

这是 Storybook 中该 story 的原样代码(zenit 5f9add5+wip 2026-09-30)。其中 W 即 ui.widgets,col / row / label 是 Storybook 内的布局小工具。The story's verbatim source from the Storybook (zenit 5f9add5+wip 2026-09-30). W is ui.widgets; col / row / label are small Storybook layout helpers.

zenit · 双授权Dual-licensed开源项目可按 GPL-3.0-only 免费使用;闭源或商业产品需要商业授权。Free for open-source projects under GPL-3.0-only; closed-source or commercial products need a commercial license.可联系作者:Contact the author: zongyi.xzy#gmail.com(# 换成 @) (replace # with @)zenit 5f9add5+wip 2026-09-30