Skip to content

时间戳

@astryxdesign/core v0.7.1 · Timestamp

属性 ​

名称类型默认值说明
valuestring | number-ISO 时刻,或按秒计的 unix 时间。会写到 datetime。
formatTimestampFormat'auto'relative、relative_short、auto、date、date_long、date_weekday、date_time、time、system_date、system_date_time、system_time 或 unix_seconds。
autoThresholdnumber604800auto 从相对时间换成 date_time 的秒数门槛。
hasTooltipbooleantrue悬停卡片里是可复制的绝对时间。tooltipEntries 会替换默认行。
tooltipEntriesTimestampTooltipEntry[]-每一项选择一种格式、可选的 timezoneID 和可选标签。
isTimezoneShownbooleanfalse在 date_time 和 time 后面加上短时区名。
isLivebooleanfalse刷新相对时间。间隔会随时刻变远而变长。
typeTextType'supporting'传给 Text 的排版角色。
sizeTextSize-可选的字号覆盖。
colorTextColor | 'disabled''secondary'disabled 由本组件自己上色。其余名称是文字颜色。
weightTextWeight-可选的字重覆盖。

不认识的 timezoneID 会在控制台警告,并回退到本地时区。

主题 ​

可见文字使用所选颜色对应的文字 token。disabled 使用 --astryx-color-text-disabled。悬停卡片是共用的 HoverCard。