Skip to content

feat(date-picker): add multi-column selection variant - #2023

Open
william-xue wants to merge 1 commit into
varletjs:devfrom
william-xue:feat/date-picker-columns
Open

william-xue wants to merge 1 commit into
varletjs:devfrom
william-xue:feat/date-picker-columns

Conversation

@william-xue

Copy link
Copy Markdown
Member

Checklist

  • Fix linting errors
  • Tests have been added / updated (or snapshots)

Change information

var-date-picker 新增 variant 属性,可选 calendar(默认,行为不变)/ columns。columns 用 var-picker 做年 / 月 / 日多列滚动选择:

  • 列数与 type 对齐:date 三列、month 两列、year 单列
  • min / max / allowed-dates 沿用现有语义(min / max 按 type 格式,allowed-dates 在最细粒度上过滤),超出范围的选项不生成;选择变化后自动贴到最近的可用值
  • 未设置 min / max 时默认范围为当前年份前后 10 年(多列需要有界)
  • 列文本用纯数字,不为 13 个语言新增 locale key
  • range / multiple 在 columns 下不生效,先做最小实现

Validation:

  • pnpm exec varlet-cli test -c date-picker 45 个用例通过(新增 6 个:三列渲染、列数随 type、min / max 过滤、allowed-dates 过滤、change 输出格式、modelValue 同步)
  • pnpm lint 通过
  • 文档(zh-CN / en-US)、示例与 locale、类型声明已同步

Issues

close #1960

Related Links

None.

Add the variant prop, the columns variant renders the year, month and day
columns with var-picker. min, max and allowedDates keep the panel semantics,
out of range options are not rendered.
@vercel

vercel Bot commented Oct 13, 2026

Copy link
Copy Markdown

@william-xue is attempting to deploy a commit to the varletjs Team on Vercel.

A member of the Team first needs to authorize it.

@pkg-pr-new

pkg-pr-new Bot commented Oct 13, 2026

Copy link
Copy Markdown

Open in StackBlitz

@varlet/cli

npm i https://pkg.pr.new/@varlet/cli@2023

@varlet/icons

npm i https://pkg.pr.new/@varlet/icons@2023

@varlet/import-resolver

npm i https://pkg.pr.new/@varlet/import-resolver@2023

@varlet/preset-tailwindcss

npm i https://pkg.pr.new/@varlet/preset-tailwindcss@2023

@varlet/preset-unocss

npm i https://pkg.pr.new/@varlet/preset-unocss@2023

@varlet/shared

npm i https://pkg.pr.new/@varlet/shared@2023

@varlet/touch-emulator

npm i https://pkg.pr.new/@varlet/touch-emulator@2023

@varlet/ui

npm i https://pkg.pr.new/@varlet/ui@2023

@varlet/use

npm i https://pkg.pr.new/@varlet/use@2023

@varlet/vite-plugins

npm i https://pkg.pr.new/@varlet/vite-plugins@2023

commit: 57066a7

@haoziqaq

Copy link
Copy Markdown
Member

暂时先不接受 pr 了,我想静静,之前的 pr 有点问题,我在修。

@william-xue

Copy link
Copy Markdown
Member Author

好的,这个先搁着不动。你那边忙完再看,需要搭把手随时喊我。

@haoziqaq

haoziqaq commented Oct 13, 2026 via email

Copy link
Copy Markdown
Member

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

DatePicker 建议添加多列选择变体

2 participants