Files
Starlight_Lancher/.agents/skills/lark-im/references/card/components/picker_datetime.md

1.5 KiB
Raw Blame History

日期时间选择器 picker_datetime

提供日期+时间选项的交互组件,默认拥有交互能力。Card 2.0

最小示例

{
  "tag": "picker_datetime",
  "placeholder": { "tag": "plain_text", "content": "请选择" },
  "initial_datetime": "2024-01-01 08:00"
}

字段

字段 必填 类型 默认 说明
tag String / 固定 picker_datetime
name 否* String / 唯一标识;form 内必填且全局唯一
required Boolean false 是否必选form 内生效)
initial_datetime String / 初始值,格式 yyyy-MM-dd HH:mm,会覆盖 placeholder
placeholder Object / 占位文本plain_text未设 initial_datetime 时必填
width String default default/fill/[100,∞)px
disabled Boolean false 是否禁用(需端版本 V7.4+
behaviors Array / [{type:"callback", value:{...}}]
confirm Object / 二次确认弹窗 {title, text}
margin String 0 [-99,99]px

嵌套 / 易错点

  • 可嵌套在 column_set / form / collapsible_panel / 循环容器 / 交互容器内;搭建工具中暂不支持嵌套在交互容器中。
  • 提醒用户注意时区语境;服务端只返回用户当前时区作为参考,不代表用户选的就是该时区。
  • 回调:action.tag="picker_datetime" + action.option(如 "2025-06-10 19:19 +0800"+ action.timezoneform 内则读 form_value[name]