跳到内容
菜单
语言,当前是简体中文
EnglishGaeilge简体中文Españolहिन्दीPortuguêsবাংলাРусский日本語廣東話Tiếng Việtالعربية

rastrillo 设计系统

设计系统所提供内容的总览。主题:signal。语言:简体中文

日期与时间

datetime.js 增强的四个字段,每个都在底层保留原生输入控件,因此没有脚本的读者得到的是朴素的控件,而不是坏掉的控件。

预先做好、彼此一致的界面元素,在服务器端渲染。

框架自己的词汇把它们叫作 partial:ui.Templates() 返回的是 partial,docs/site/templates.md 也用这个名字。这页上的说法换了,代码里的没换。

这里的链接不可点

链接不可点,示例源码另行提供。

下面每个示例都在自己的框里。

示例内容为英文,示例外壳已翻译。

field-date

一个原生日期输入框,外加 datetime.js 启用的自然语言组合框(除非调用方传了 Plain)。试着输入「明天」。

增强输入:键入“明天”或“3 周后”

预览
<section rst-box><form rst-form method="post" action="#"><div rst-field>
  <label rst-field-label for="field-date_live">Publish on</label>
  <input rst-input id="field-date_live" name="field-date_live" type="date" value="2026-09-04" aria-describedby="field-date_live-hint" data-rst-date data-rst-date-words="{&#34;ago&#34;:&#34;前&#34;,&#34;am&#34;:&#34;上午|早上|am&#34;,&#34;at&#34;:&#34;在&#34;,&#34;day&#34;:&#34;天|日|号&#34;,&#34;hour&#34;:&#34;小时|钟头|点&#34;,&#34;in&#34;:&#34;后&#34;,&#34;last&#34;:&#34;上|上个&#34;,&#34;midnight&#34;:&#34;午夜|半夜&#34;,&#34;minute&#34;:&#34;分钟|分&#34;,&#34;month&#34;:&#34;月|个月&#34;,&#34;next&#34;:&#34;下|下个&#34;,&#34;noon&#34;:&#34;中午|正午&#34;,&#34;pm&#34;:&#34;下午|晚上|pm&#34;,&#34;today&#34;:&#34;今天|今日&#34;,&#34;tomorrow&#34;:&#34;明天|明日&#34;,&#34;week&#34;:&#34;周|星期|礼拜&#34;,&#34;yesterday&#34;:&#34;昨天|昨日&#34;}" data-rst-date-set="设定" data-rst-date-hint="试试:{example}" data-rst-date-pick="打开日历" data-rst-date-calendar="日历" data-rst-date-prev-month="上一个月" data-rst-date-next-month="下一个月" data-rst-date-results="{n} 条建议" data-rst-date-result-one="1 条建议" data-rst-date-quick-today="今天" data-rst-date-quick-tomorrow="明天" data-rst-date-quick-next-week="一周后" data-rst-date-quick-plus-1h="一小时后" data-rst-date-quick-plus-2h="两小时后" data-rst-date-quick-end-of-day="当天结束时" data-rst-date-quick-next-day="次日同一时间">
  <small rst-field-hint id="field-date_live-hint">The day it goes live.</small>
</div></form></section>

它能解析的词是通过 data-rst-date-words 传出去的,取自这一页的目录:字段解析的正是这一页所用的语言。

必填,并带错误

预览
<section rst-box><form rst-form method="post" action="#"><div rst-field>
  <label rst-field-label for="field-date_error">Publish on <span rst-field-required aria-hidden="true">*</span></label>
  <input rst-input id="field-date_error" name="field-date_error" type="date" required aria-invalid="true" aria-describedby="field-date_error-error" data-rst-date data-rst-date-words="{&#34;ago&#34;:&#34;前&#34;,&#34;am&#34;:&#34;上午|早上|am&#34;,&#34;at&#34;:&#34;在&#34;,&#34;day&#34;:&#34;天|日|号&#34;,&#34;hour&#34;:&#34;小时|钟头|点&#34;,&#34;in&#34;:&#34;后&#34;,&#34;last&#34;:&#34;上|上个&#34;,&#34;midnight&#34;:&#34;午夜|半夜&#34;,&#34;minute&#34;:&#34;分钟|分&#34;,&#34;month&#34;:&#34;月|个月&#34;,&#34;next&#34;:&#34;下|下个&#34;,&#34;noon&#34;:&#34;中午|正午&#34;,&#34;pm&#34;:&#34;下午|晚上|pm&#34;,&#34;today&#34;:&#34;今天|今日&#34;,&#34;tomorrow&#34;:&#34;明天|明日&#34;,&#34;week&#34;:&#34;周|星期|礼拜&#34;,&#34;yesterday&#34;:&#34;昨天|昨日&#34;}" data-rst-date-set="设定" data-rst-date-hint="试试:{example}" data-rst-date-pick="打开日历" data-rst-date-calendar="日历" data-rst-date-prev-month="上一个月" data-rst-date-next-month="下一个月" data-rst-date-results="{n} 条建议" data-rst-date-result-one="1 条建议" data-rst-date-quick-today="今天" data-rst-date-quick-tomorrow="明天" data-rst-date-quick-next-week="一周后" data-rst-date-quick-plus-1h="一小时后" data-rst-date-quick-plus-2h="两小时后" data-rst-date-quick-end-of-day="当天结束时" data-rst-date-quick-next-day="次日同一时间">
  <small rst-field-error id="field-date_error-error">Pick a date after today.</small>
</div></form></section>

有上下限

预览
<section rst-box><form rst-form method="post" action="#"><div rst-field>
  <label rst-field-label for="field-date_bounded">Within this year</label>
  <input rst-input id="field-date_bounded" name="field-date_bounded" type="date" value="2026-09-04" min="2026-01-01" max="2026-12-31" data-rst-date data-rst-date-words="{&#34;ago&#34;:&#34;前&#34;,&#34;am&#34;:&#34;上午|早上|am&#34;,&#34;at&#34;:&#34;在&#34;,&#34;day&#34;:&#34;天|日|号&#34;,&#34;hour&#34;:&#34;小时|钟头|点&#34;,&#34;in&#34;:&#34;后&#34;,&#34;last&#34;:&#34;上|上个&#34;,&#34;midnight&#34;:&#34;午夜|半夜&#34;,&#34;minute&#34;:&#34;分钟|分&#34;,&#34;month&#34;:&#34;月|个月&#34;,&#34;next&#34;:&#34;下|下个&#34;,&#34;noon&#34;:&#34;中午|正午&#34;,&#34;pm&#34;:&#34;下午|晚上|pm&#34;,&#34;today&#34;:&#34;今天|今日&#34;,&#34;tomorrow&#34;:&#34;明天|明日&#34;,&#34;week&#34;:&#34;周|星期|礼拜&#34;,&#34;yesterday&#34;:&#34;昨天|昨日&#34;}" data-rst-date-set="设定" data-rst-date-hint="试试:{example}" data-rst-date-pick="打开日历" data-rst-date-calendar="日历" data-rst-date-prev-month="上一个月" data-rst-date-next-month="下一个月" data-rst-date-results="{n} 条建议" data-rst-date-result-one="1 条建议" data-rst-date-quick-today="今天" data-rst-date-quick-tomorrow="明天" data-rst-date-quick-next-week="一周后" data-rst-date-quick-plus-1h="一小时后" data-rst-date-quick-plus-2h="两小时后" data-rst-date-quick-end-of-day="当天结束时" data-rst-date-quick-next-day="次日同一时间">
</div></form></section>

Plain——不加修饰的原生输入框

预览
<section rst-box><form rst-form method="post" action="#"><div rst-field>
  <label rst-field-label for="field-date_plain">Publish on</label>
  <input rst-input id="field-date_plain" name="field-date_plain" type="date" value="2026-09-04">
</div></form></section>

完全没有增强属性,所以 datetime.js 找不到任何东西。原生选择器照样打得开。

field-time

同样的外壳,包着一个原生时间输入框。这次增强读的是钟点,不是日历。

增强输入:键入“七点半”或“中午”

预览
<section rst-box><form rst-form method="post" action="#"><div rst-field>
  <label rst-field-label for="time_live">Doors open</label>
  <input rst-input id="time_live" name="time_live" type="time" value="19:30" aria-describedby="time_live-hint" data-rst-time data-rst-date-words="{&#34;ago&#34;:&#34;前&#34;,&#34;am&#34;:&#34;上午|早上|am&#34;,&#34;at&#34;:&#34;在&#34;,&#34;day&#34;:&#34;天|日|号&#34;,&#34;hour&#34;:&#34;小时|钟头|点&#34;,&#34;in&#34;:&#34;后&#34;,&#34;last&#34;:&#34;上|上个&#34;,&#34;midnight&#34;:&#34;午夜|半夜&#34;,&#34;minute&#34;:&#34;分钟|分&#34;,&#34;month&#34;:&#34;月|个月&#34;,&#34;next&#34;:&#34;下|下个&#34;,&#34;noon&#34;:&#34;中午|正午&#34;,&#34;pm&#34;:&#34;下午|晚上|pm&#34;,&#34;today&#34;:&#34;今天|今日&#34;,&#34;tomorrow&#34;:&#34;明天|明日&#34;,&#34;week&#34;:&#34;周|星期|礼拜&#34;,&#34;yesterday&#34;:&#34;昨天|昨日&#34;}" data-rst-date-set="设定" data-rst-date-hint="试试:{example}" data-rst-date-pick="打开日历" data-rst-date-pick-time="打开时钟" data-rst-date-results="{n} 条建议" data-rst-date-result-one="1 条建议" data-rst-date-quick-today="今天" data-rst-date-quick-tomorrow="明天" data-rst-date-quick-next-week="一周后" data-rst-date-quick-plus-1h="一小时后" data-rst-date-quick-plus-2h="两小时后" data-rst-date-quick-end-of-day="当天结束时" data-rst-date-quick-next-day="次日同一时间">
  <small rst-field-hint id="time_live-hint">Local time.</small>
</div></form></section>

必填,并带错误

预览
<section rst-box><form rst-form method="post" action="#"><div rst-field>
  <label rst-field-label for="time_error">Doors open <span rst-field-required aria-hidden="true">*</span></label>
  <input rst-input id="time_error" name="time_error" type="time" required aria-invalid="true" aria-describedby="time_error-error" data-rst-time data-rst-date-words="{&#34;ago&#34;:&#34;前&#34;,&#34;am&#34;:&#34;上午|早上|am&#34;,&#34;at&#34;:&#34;在&#34;,&#34;day&#34;:&#34;天|日|号&#34;,&#34;hour&#34;:&#34;小时|钟头|点&#34;,&#34;in&#34;:&#34;后&#34;,&#34;last&#34;:&#34;上|上个&#34;,&#34;midnight&#34;:&#34;午夜|半夜&#34;,&#34;minute&#34;:&#34;分钟|分&#34;,&#34;month&#34;:&#34;月|个月&#34;,&#34;next&#34;:&#34;下|下个&#34;,&#34;noon&#34;:&#34;中午|正午&#34;,&#34;pm&#34;:&#34;下午|晚上|pm&#34;,&#34;today&#34;:&#34;今天|今日&#34;,&#34;tomorrow&#34;:&#34;明天|明日&#34;,&#34;week&#34;:&#34;周|星期|礼拜&#34;,&#34;yesterday&#34;:&#34;昨天|昨日&#34;}" data-rst-date-set="设定" data-rst-date-hint="试试:{example}" data-rst-date-pick="打开日历" data-rst-date-pick-time="打开时钟" data-rst-date-results="{n} 条建议" data-rst-date-result-one="1 条建议" data-rst-date-quick-today="今天" data-rst-date-quick-tomorrow="明天" data-rst-date-quick-next-week="一周后" data-rst-date-quick-plus-1h="一小时后" data-rst-date-quick-plus-2h="两小时后" data-rst-date-quick-end-of-day="当天结束时" data-rst-date-quick-next-day="次日同一时间">
  <small rst-field-error id="time_error-error">Pick a time after the sound check.</small>
</div></form></section>

有上下限

预览
<section rst-box><form rst-form method="post" action="#"><div rst-field>
  <label rst-field-label for="time_bounded">Between nine and eleven</label>
  <input rst-input id="time_bounded" name="time_bounded" type="time" value="19:30" min="09:00" max="23:00" data-rst-time data-rst-date-words="{&#34;ago&#34;:&#34;前&#34;,&#34;am&#34;:&#34;上午|早上|am&#34;,&#34;at&#34;:&#34;在&#34;,&#34;day&#34;:&#34;天|日|号&#34;,&#34;hour&#34;:&#34;小时|钟头|点&#34;,&#34;in&#34;:&#34;后&#34;,&#34;last&#34;:&#34;上|上个&#34;,&#34;midnight&#34;:&#34;午夜|半夜&#34;,&#34;minute&#34;:&#34;分钟|分&#34;,&#34;month&#34;:&#34;月|个月&#34;,&#34;next&#34;:&#34;下|下个&#34;,&#34;noon&#34;:&#34;中午|正午&#34;,&#34;pm&#34;:&#34;下午|晚上|pm&#34;,&#34;today&#34;:&#34;今天|今日&#34;,&#34;tomorrow&#34;:&#34;明天|明日&#34;,&#34;week&#34;:&#34;周|星期|礼拜&#34;,&#34;yesterday&#34;:&#34;昨天|昨日&#34;}" data-rst-date-set="设定" data-rst-date-hint="试试:{example}" data-rst-date-pick="打开日历" data-rst-date-pick-time="打开时钟" data-rst-date-results="{n} 条建议" data-rst-date-result-one="1 条建议" data-rst-date-quick-today="今天" data-rst-date-quick-tomorrow="明天" data-rst-date-quick-next-week="一周后" data-rst-date-quick-plus-1h="一小时后" data-rst-date-quick-plus-2h="两小时后" data-rst-date-quick-end-of-day="当天结束时" data-rst-date-quick-next-day="次日同一时间">
</div></form></section>

Plain——不加修饰的原生输入框

预览
<section rst-box><form rst-form method="post" action="#"><div rst-field>
  <label rst-field-label for="time_plain">Doors open</label>
  <input rst-input id="time_plain" name="time_plain" type="time" value="19:30">
</div></form></section>

field-datetime

一个输入框里的日期和时间,一个值。

增强输入:键入“明天”或“3 周后”

预览
<section rst-box><form rst-form method="post" action="#"><div rst-field>
  <label rst-field-label for="field-datetime_live">Publish on</label>
  <input rst-input id="field-datetime_live" name="field-datetime_live" type="datetime-local" value="2026-09-04T19:30" aria-describedby="field-datetime_live-hint" data-rst-date data-rst-date-words="{&#34;ago&#34;:&#34;前&#34;,&#34;am&#34;:&#34;上午|早上|am&#34;,&#34;at&#34;:&#34;在&#34;,&#34;day&#34;:&#34;天|日|号&#34;,&#34;hour&#34;:&#34;小时|钟头|点&#34;,&#34;in&#34;:&#34;后&#34;,&#34;last&#34;:&#34;上|上个&#34;,&#34;midnight&#34;:&#34;午夜|半夜&#34;,&#34;minute&#34;:&#34;分钟|分&#34;,&#34;month&#34;:&#34;月|个月&#34;,&#34;next&#34;:&#34;下|下个&#34;,&#34;noon&#34;:&#34;中午|正午&#34;,&#34;pm&#34;:&#34;下午|晚上|pm&#34;,&#34;today&#34;:&#34;今天|今日&#34;,&#34;tomorrow&#34;:&#34;明天|明日&#34;,&#34;week&#34;:&#34;周|星期|礼拜&#34;,&#34;yesterday&#34;:&#34;昨天|昨日&#34;}" data-rst-date-set="设定" data-rst-date-hint="试试:{example}" data-rst-date-pick="打开日历" data-rst-date-calendar="日历" data-rst-date-prev-month="上一个月" data-rst-date-next-month="下一个月" data-rst-date-results="{n} 条建议" data-rst-date-result-one="1 条建议" data-rst-date-quick-today="今天" data-rst-date-quick-tomorrow="明天" data-rst-date-quick-next-week="一周后" data-rst-date-quick-plus-1h="一小时后" data-rst-date-quick-plus-2h="两小时后" data-rst-date-quick-end-of-day="当天结束时" data-rst-date-quick-next-day="次日同一时间">
  <small rst-field-hint id="field-datetime_live-hint">When it goes live.</small>
</div></form></section>

它能解析的词是通过 data-rst-date-words 传出去的,取自这一页的目录:字段解析的正是这一页所用的语言。

必填,并带错误

预览
<section rst-box><form rst-form method="post" action="#"><div rst-field>
  <label rst-field-label for="field-datetime_error">Publish on <span rst-field-required aria-hidden="true">*</span></label>
  <input rst-input id="field-datetime_error" name="field-datetime_error" type="datetime-local" required aria-invalid="true" aria-describedby="field-datetime_error-error" data-rst-date data-rst-date-words="{&#34;ago&#34;:&#34;前&#34;,&#34;am&#34;:&#34;上午|早上|am&#34;,&#34;at&#34;:&#34;在&#34;,&#34;day&#34;:&#34;天|日|号&#34;,&#34;hour&#34;:&#34;小时|钟头|点&#34;,&#34;in&#34;:&#34;后&#34;,&#34;last&#34;:&#34;上|上个&#34;,&#34;midnight&#34;:&#34;午夜|半夜&#34;,&#34;minute&#34;:&#34;分钟|分&#34;,&#34;month&#34;:&#34;月|个月&#34;,&#34;next&#34;:&#34;下|下个&#34;,&#34;noon&#34;:&#34;中午|正午&#34;,&#34;pm&#34;:&#34;下午|晚上|pm&#34;,&#34;today&#34;:&#34;今天|今日&#34;,&#34;tomorrow&#34;:&#34;明天|明日&#34;,&#34;week&#34;:&#34;周|星期|礼拜&#34;,&#34;yesterday&#34;:&#34;昨天|昨日&#34;}" data-rst-date-set="设定" data-rst-date-hint="试试:{example}" data-rst-date-pick="打开日历" data-rst-date-calendar="日历" data-rst-date-prev-month="上一个月" data-rst-date-next-month="下一个月" data-rst-date-results="{n} 条建议" data-rst-date-result-one="1 条建议" data-rst-date-quick-today="今天" data-rst-date-quick-tomorrow="明天" data-rst-date-quick-next-week="一周后" data-rst-date-quick-plus-1h="一小时后" data-rst-date-quick-plus-2h="两小时后" data-rst-date-quick-end-of-day="当天结束时" data-rst-date-quick-next-day="次日同一时间">
  <small rst-field-error id="field-datetime_error-error">Pick a date after today.</small>
</div></form></section>

有上下限

预览
<section rst-box><form rst-form method="post" action="#"><div rst-field>
  <label rst-field-label for="field-datetime_bounded">Within this year</label>
  <input rst-input id="field-datetime_bounded" name="field-datetime_bounded" type="datetime-local" value="2026-09-04T19:30" min="2026-01-01T00:00" max="2026-12-31T23:59" data-rst-date data-rst-date-words="{&#34;ago&#34;:&#34;前&#34;,&#34;am&#34;:&#34;上午|早上|am&#34;,&#34;at&#34;:&#34;在&#34;,&#34;day&#34;:&#34;天|日|号&#34;,&#34;hour&#34;:&#34;小时|钟头|点&#34;,&#34;in&#34;:&#34;后&#34;,&#34;last&#34;:&#34;上|上个&#34;,&#34;midnight&#34;:&#34;午夜|半夜&#34;,&#34;minute&#34;:&#34;分钟|分&#34;,&#34;month&#34;:&#34;月|个月&#34;,&#34;next&#34;:&#34;下|下个&#34;,&#34;noon&#34;:&#34;中午|正午&#34;,&#34;pm&#34;:&#34;下午|晚上|pm&#34;,&#34;today&#34;:&#34;今天|今日&#34;,&#34;tomorrow&#34;:&#34;明天|明日&#34;,&#34;week&#34;:&#34;周|星期|礼拜&#34;,&#34;yesterday&#34;:&#34;昨天|昨日&#34;}" data-rst-date-set="设定" data-rst-date-hint="试试:{example}" data-rst-date-pick="打开日历" data-rst-date-calendar="日历" data-rst-date-prev-month="上一个月" data-rst-date-next-month="下一个月" data-rst-date-results="{n} 条建议" data-rst-date-result-one="1 条建议" data-rst-date-quick-today="今天" data-rst-date-quick-tomorrow="明天" data-rst-date-quick-next-week="一周后" data-rst-date-quick-plus-1h="一小时后" data-rst-date-quick-plus-2h="两小时后" data-rst-date-quick-end-of-day="当天结束时" data-rst-date-quick-next-day="次日同一时间">
</div></form></section>

Plain——不加修饰的原生输入框

预览
<section rst-box><form rst-form method="post" action="#"><div rst-field>
  <label rst-field-label for="field-datetime_plain">Publish on</label>
  <input rst-input id="field-datetime_plain" name="field-datetime_plain" type="datetime-local" value="2026-09-04T19:30">
</div></form></section>

完全没有增强属性,所以 datetime.js 找不到任何东西。原生选择器照样打得开。

field-daterange

起点和终点作为一个带标签的整体。两者的 Name 必须不同,因为 id 是由它推导出来的。

日期和时间,已预填

预览
<section rst-box><form rst-form method="post" action="#"><fieldset rst-field-range>
  <legend>When</legend>
  <div rst-field-row data-rst-range="session">
    <div rst-field>
  <label rst-field-label for="dr_starts_at">Starts</label>
  <input rst-input id="dr_starts_at" name="dr_starts_at" type="datetime-local" value="2026-09-04T19:30" data-rst-date data-rst-date-words="{&#34;ago&#34;:&#34;前&#34;,&#34;am&#34;:&#34;上午|早上|am&#34;,&#34;at&#34;:&#34;在&#34;,&#34;day&#34;:&#34;天|日|号&#34;,&#34;hour&#34;:&#34;小时|钟头|点&#34;,&#34;in&#34;:&#34;后&#34;,&#34;last&#34;:&#34;上|上个&#34;,&#34;midnight&#34;:&#34;午夜|半夜&#34;,&#34;minute&#34;:&#34;分钟|分&#34;,&#34;month&#34;:&#34;月|个月&#34;,&#34;next&#34;:&#34;下|下个&#34;,&#34;noon&#34;:&#34;中午|正午&#34;,&#34;pm&#34;:&#34;下午|晚上|pm&#34;,&#34;today&#34;:&#34;今天|今日&#34;,&#34;tomorrow&#34;:&#34;明天|明日&#34;,&#34;week&#34;:&#34;周|星期|礼拜&#34;,&#34;yesterday&#34;:&#34;昨天|昨日&#34;}" data-rst-date-set="设定" data-rst-date-hint="试试:{example}" data-rst-date-pick="打开日历" data-rst-date-calendar="日历" data-rst-date-prev-month="上一个月" data-rst-date-next-month="下一个月" data-rst-date-results="{n} 条建议" data-rst-date-result-one="1 条建议" data-rst-date-quick-today="今天" data-rst-date-quick-tomorrow="明天" data-rst-date-quick-next-week="一周后" data-rst-date-quick-plus-1h="一小时后" data-rst-date-quick-plus-2h="两小时后" data-rst-date-quick-end-of-day="当天结束时" data-rst-date-quick-next-day="次日同一时间">
</div>
    <div rst-field>
  <label rst-field-label for="dr_ends_at">Ends</label>
  <input rst-input id="dr_ends_at" name="dr_ends_at" type="datetime-local" data-rst-date data-rst-date-words="{&#34;ago&#34;:&#34;前&#34;,&#34;am&#34;:&#34;上午|早上|am&#34;,&#34;at&#34;:&#34;在&#34;,&#34;day&#34;:&#34;天|日|号&#34;,&#34;hour&#34;:&#34;小时|钟头|点&#34;,&#34;in&#34;:&#34;后&#34;,&#34;last&#34;:&#34;上|上个&#34;,&#34;midnight&#34;:&#34;午夜|半夜&#34;,&#34;minute&#34;:&#34;分钟|分&#34;,&#34;month&#34;:&#34;月|个月&#34;,&#34;next&#34;:&#34;下|下个&#34;,&#34;noon&#34;:&#34;中午|正午&#34;,&#34;pm&#34;:&#34;下午|晚上|pm&#34;,&#34;today&#34;:&#34;今天|今日&#34;,&#34;tomorrow&#34;:&#34;明天|明日&#34;,&#34;week&#34;:&#34;周|星期|礼拜&#34;,&#34;yesterday&#34;:&#34;昨天|昨日&#34;}" data-rst-date-set="设定" data-rst-date-hint="试试:{example}" data-rst-date-pick="打开日历" data-rst-date-calendar="日历" data-rst-date-prev-month="上一个月" data-rst-date-next-month="下一个月" data-rst-date-results="{n} 条建议" data-rst-date-result-one="1 条建议" data-rst-date-quick-today="今天" data-rst-date-quick-tomorrow="明天" data-rst-date-quick-next-week="一周后" data-rst-date-quick-plus-1h="一小时后" data-rst-date-quick-plus-2h="两小时后" data-rst-date-quick-end-of-day="当天结束时" data-rst-date-quick-next-day="次日同一时间">
</div>
  </div>
</fieldset></form></section>

在结束时间还空着的时候确定开始时间,浏览器会把结束填成一小时之后。服务器端没有预填任何值。

只有日期,结束一侧带错误

预览
<section rst-box><form rst-form method="post" action="#"><fieldset rst-field-range>
  <legend>Booking</legend>
  <div rst-field-row data-rst-range>
    <div rst-field>
  <label rst-field-label for="dr_from">From</label>
  <input rst-input id="dr_from" name="dr_from" type="date" value="2026-09-04" data-rst-date data-rst-date-words="{&#34;ago&#34;:&#34;前&#34;,&#34;am&#34;:&#34;上午|早上|am&#34;,&#34;at&#34;:&#34;在&#34;,&#34;day&#34;:&#34;天|日|号&#34;,&#34;hour&#34;:&#34;小时|钟头|点&#34;,&#34;in&#34;:&#34;后&#34;,&#34;last&#34;:&#34;上|上个&#34;,&#34;midnight&#34;:&#34;午夜|半夜&#34;,&#34;minute&#34;:&#34;分钟|分&#34;,&#34;month&#34;:&#34;月|个月&#34;,&#34;next&#34;:&#34;下|下个&#34;,&#34;noon&#34;:&#34;中午|正午&#34;,&#34;pm&#34;:&#34;下午|晚上|pm&#34;,&#34;today&#34;:&#34;今天|今日&#34;,&#34;tomorrow&#34;:&#34;明天|明日&#34;,&#34;week&#34;:&#34;周|星期|礼拜&#34;,&#34;yesterday&#34;:&#34;昨天|昨日&#34;}" data-rst-date-set="设定" data-rst-date-hint="试试:{example}" data-rst-date-pick="打开日历" data-rst-date-calendar="日历" data-rst-date-prev-month="上一个月" data-rst-date-next-month="下一个月" data-rst-date-results="{n} 条建议" data-rst-date-result-one="1 条建议" data-rst-date-quick-today="今天" data-rst-date-quick-tomorrow="明天" data-rst-date-quick-next-week="一周后" data-rst-date-quick-plus-1h="一小时后" data-rst-date-quick-plus-2h="两小时后" data-rst-date-quick-end-of-day="当天结束时" data-rst-date-quick-next-day="次日同一时间">
</div>
    <div rst-field>
  <label rst-field-label for="dr_to">To</label>
  <input rst-input id="dr_to" name="dr_to" type="date" value="2026-09-01" aria-invalid="true" aria-describedby="dr_to-error" data-rst-date data-rst-date-words="{&#34;ago&#34;:&#34;前&#34;,&#34;am&#34;:&#34;上午|早上|am&#34;,&#34;at&#34;:&#34;在&#34;,&#34;day&#34;:&#34;天|日|号&#34;,&#34;hour&#34;:&#34;小时|钟头|点&#34;,&#34;in&#34;:&#34;后&#34;,&#34;last&#34;:&#34;上|上个&#34;,&#34;midnight&#34;:&#34;午夜|半夜&#34;,&#34;minute&#34;:&#34;分钟|分&#34;,&#34;month&#34;:&#34;月|个月&#34;,&#34;next&#34;:&#34;下|下个&#34;,&#34;noon&#34;:&#34;中午|正午&#34;,&#34;pm&#34;:&#34;下午|晚上|pm&#34;,&#34;today&#34;:&#34;今天|今日&#34;,&#34;tomorrow&#34;:&#34;明天|明日&#34;,&#34;week&#34;:&#34;周|星期|礼拜&#34;,&#34;yesterday&#34;:&#34;昨天|昨日&#34;}" data-rst-date-set="设定" data-rst-date-hint="试试:{example}" data-rst-date-pick="打开日历" data-rst-date-calendar="日历" data-rst-date-prev-month="上一个月" data-rst-date-next-month="下一个月" data-rst-date-results="{n} 条建议" data-rst-date-result-one="1 条建议" data-rst-date-quick-today="今天" data-rst-date-quick-tomorrow="明天" data-rst-date-quick-next-week="一周后" data-rst-date-quick-plus-1h="一小时后" data-rst-date-quick-plus-2h="两小时后" data-rst-date-quick-end-of-day="当天结束时" data-rst-date-quick-next-day="次日同一时间">
  <small rst-field-error id="dr_to-error">The end comes before the start.</small>
</div>
  </div>
</fieldset></form></section>