field-daterange
Data e hora Os quatro campos que o datetime.js melhora, cada um mantendo por baixo o seu controlo nativo, para que quem não tenha scripts receba o controlo simples e não um partido.
Um início e um fim como um único fieldset com etiqueta. Dê a cada campo o seu próprio name e id.
Cada exemplo funciona de verdade, mas as suas ligações não levam a lado nenhum. HTML mostra a marcação para copiar.
Data e hora, com valores iniciais
Confirme o início com o fim ainda vazio e o datetime.js preenche o fim uma hora depois. Nada na marcação faz isso; é o script que o faz.
Coloque isto dentro de <section rst-box><form rst-form>.
<fieldset rst-field-range >
<legend >Quando</legend >
<div rst-field-row data-rst-range ="session" >
<div rst-field >
<label rst-field-label for ="dr_starts_at" >Começa</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 ="{"ago":"atrás|atras|há|ha","am":"am|a.m.|manhã|manha","at":"às|as|à|a","day":"dia|dias","hour":"hora|horas|h","in":"em|daqui","last":"passado|passada|último|ultimo|última|ultima|anterior","midnight":"meia-noite|meia noite","minute":"minuto|minutos|min|mins|m","month":"mês|mes|meses","next":"próximo|proximo|próxima|proxima|seguinte","noon":"meio-dia|meio dia","pm":"pm|p.m.|tarde|noite","today":"hoje","tomorrow":"amanhã|amanha","week":"semana|semanas","yesterday":"ontem"}" data-rst-date-set ="Definir" data-rst-date-hint ="Experimente: {example}" data-rst-date-pick ="Abrir o calendário" data-rst-date-calendar ="Calendário" data-rst-date-prev-month ="Mês anterior" data-rst-date-next-month ="Mês seguinte" data-rst-date-results ="{n} sugestões" data-rst-date-result-one ="1 sugestão" data-rst-date-quick-today ="Hoje" data-rst-date-quick-tomorrow ="Amanhã" data-rst-date-quick-next-week ="Dentro de uma semana" data-rst-date-quick-plus-1h ="Uma hora depois" data-rst-date-quick-plus-2h ="Duas horas depois" data-rst-date-quick-end-of-day ="Fim desse dia" data-rst-date-quick-next-day ="À mesma hora no dia seguinte" >
</div >
<div rst-field >
<label rst-field-label for ="dr_ends_at" >Termina</label >
<input rst-input id ="dr_ends_at" name ="dr_ends_at" type ="datetime-local" data-rst-date data-rst-date-words ="{"ago":"atrás|atras|há|ha","am":"am|a.m.|manhã|manha","at":"às|as|à|a","day":"dia|dias","hour":"hora|horas|h","in":"em|daqui","last":"passado|passada|último|ultimo|última|ultima|anterior","midnight":"meia-noite|meia noite","minute":"minuto|minutos|min|mins|m","month":"mês|mes|meses","next":"próximo|proximo|próxima|proxima|seguinte","noon":"meio-dia|meio dia","pm":"pm|p.m.|tarde|noite","today":"hoje","tomorrow":"amanhã|amanha","week":"semana|semanas","yesterday":"ontem"}" data-rst-date-set ="Definir" data-rst-date-hint ="Experimente: {example}" data-rst-date-pick ="Abrir o calendário" data-rst-date-calendar ="Calendário" data-rst-date-prev-month ="Mês anterior" data-rst-date-next-month ="Mês seguinte" data-rst-date-results ="{n} sugestões" data-rst-date-result-one ="1 sugestão" data-rst-date-quick-today ="Hoje" data-rst-date-quick-tomorrow ="Amanhã" data-rst-date-quick-next-week ="Dentro de uma semana" data-rst-date-quick-plus-1h ="Uma hora depois" data-rst-date-quick-plus-2h ="Duas horas depois" data-rst-date-quick-end-of-day ="Fim desse dia" data-rst-date-quick-next-day ="À mesma hora no dia seguinte" >
</div >
</div >
</fieldset >
Só datas, com um erro no fim
Coloque isto dentro de <section rst-box><form rst-form>.
<fieldset rst-field-range >
<legend >Reserva</legend >
<div rst-field-row data-rst-range >
<div rst-field >
<label rst-field-label for ="dr_from" >De</label >
<input rst-input id ="dr_from" name ="dr_from" type ="date" value ="2026-09-04" data-rst-date data-rst-date-words ="{"ago":"atrás|atras|há|ha","am":"am|a.m.|manhã|manha","at":"às|as|à|a","day":"dia|dias","hour":"hora|horas|h","in":"em|daqui","last":"passado|passada|último|ultimo|última|ultima|anterior","midnight":"meia-noite|meia noite","minute":"minuto|minutos|min|mins|m","month":"mês|mes|meses","next":"próximo|proximo|próxima|proxima|seguinte","noon":"meio-dia|meio dia","pm":"pm|p.m.|tarde|noite","today":"hoje","tomorrow":"amanhã|amanha","week":"semana|semanas","yesterday":"ontem"}" data-rst-date-set ="Definir" data-rst-date-hint ="Experimente: {example}" data-rst-date-pick ="Abrir o calendário" data-rst-date-calendar ="Calendário" data-rst-date-prev-month ="Mês anterior" data-rst-date-next-month ="Mês seguinte" data-rst-date-results ="{n} sugestões" data-rst-date-result-one ="1 sugestão" data-rst-date-quick-today ="Hoje" data-rst-date-quick-tomorrow ="Amanhã" data-rst-date-quick-next-week ="Dentro de uma semana" data-rst-date-quick-plus-1h ="Uma hora depois" data-rst-date-quick-plus-2h ="Duas horas depois" data-rst-date-quick-end-of-day ="Fim desse dia" data-rst-date-quick-next-day ="À mesma hora no dia seguinte" >
</div >
<div rst-field >
<label rst-field-label for ="dr_to" >Até</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 ="{"ago":"atrás|atras|há|ha","am":"am|a.m.|manhã|manha","at":"às|as|à|a","day":"dia|dias","hour":"hora|horas|h","in":"em|daqui","last":"passado|passada|último|ultimo|última|ultima|anterior","midnight":"meia-noite|meia noite","minute":"minuto|minutos|min|mins|m","month":"mês|mes|meses","next":"próximo|proximo|próxima|proxima|seguinte","noon":"meio-dia|meio dia","pm":"pm|p.m.|tarde|noite","today":"hoje","tomorrow":"amanhã|amanha","week":"semana|semanas","yesterday":"ontem"}" data-rst-date-set ="Definir" data-rst-date-hint ="Experimente: {example}" data-rst-date-pick ="Abrir o calendário" data-rst-date-calendar ="Calendário" data-rst-date-prev-month ="Mês anterior" data-rst-date-next-month ="Mês seguinte" data-rst-date-results ="{n} sugestões" data-rst-date-result-one ="1 sugestão" data-rst-date-quick-today ="Hoje" data-rst-date-quick-tomorrow ="Amanhã" data-rst-date-quick-next-week ="Dentro de uma semana" data-rst-date-quick-plus-1h ="Uma hora depois" data-rst-date-quick-plus-2h ="Duas horas depois" data-rst-date-quick-end-of-day ="Fim desse dia" data-rst-date-quick-next-day ="À mesma hora no dia seguinte" >
<small rst-field-error id ="dr_to-error" >O fim vem antes do início.</small >
</div >
</div >
</fieldset >