field-date
Fecha y hora Los cuatro campos que datetime.js mejora, cada uno conservando debajo su control nativo, de modo que quien no tenga scripts obtiene el control sencillo y no uno roto.
Un campo de fecha nativo, más el combo de lenguaje natural que datetime.js añade cuando el campo lleva data-rst-date. Escribe "mañana" en él.
Cada ejemplo funciona de verdad, pero sus enlaces no llevan a ninguna parte. HTML muestra el marcado para copiar.
Campo mejorado: escribe "mañana" o "en 3 semanas"
Las palabras que analiza están en data-rst-date-words, aquí en el idioma de la página. i18n/<lang>.json las tiene en doce idiomas, así que el campo puede analizar el idioma en el que esté la página, sea cual sea.
Pon esto dentro de <section rst-box><form rst-form>.
<div rst-field >
<label rst-field-label for ="field-date_live" >Publicar el</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 ="{"ago":"hace","am":"am|a.m.","at":"a|las|la","day":"día|dia|días|dias","hour":"hora|horas|h","in":"en","last":"pasado|pasada|último|ultimo|última|ultima|anterior","midnight":"medianoche","minute":"minuto|minutos|min|mins|m","month":"mes|meses","next":"próximo|proximo|próxima|proxima|siguiente","noon":"mediodía|mediodia","pm":"pm|p.m.|tarde|noche","today":"hoy","tomorrow":"mañana|manana","week":"semana|semanas","yesterday":"ayer"}" data-rst-date-set ="Establecer" data-rst-date-hint ="Prueba: {example}" data-rst-date-pick ="Abrir el calendario" data-rst-date-calendar ="Calendario" data-rst-date-prev-month ="Mes anterior" data-rst-date-next-month ="Mes siguiente" data-rst-date-results ="{n} sugerencias" data-rst-date-result-one ="1 sugerencia" data-rst-date-quick-today ="Hoy" data-rst-date-quick-tomorrow ="Mañana" data-rst-date-quick-next-week ="Dentro de una semana" data-rst-date-quick-plus-1h ="Una hora después" data-rst-date-quick-plus-2h ="Dos horas después" data-rst-date-quick-end-of-day ="Final de ese día" data-rst-date-quick-next-day ="A la misma hora del día siguiente" >
<small rst-field-hint id ="field-date_live-hint" >El día en que se publica.</small >
</div >
Obligatorio, con un error
Pon esto dentro de <section rst-box><form rst-form>.
<div rst-field >
<label rst-field-label for ="field-date_error" >Publicar el <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 ="{"ago":"hace","am":"am|a.m.","at":"a|las|la","day":"día|dia|días|dias","hour":"hora|horas|h","in":"en","last":"pasado|pasada|último|ultimo|última|ultima|anterior","midnight":"medianoche","minute":"minuto|minutos|min|mins|m","month":"mes|meses","next":"próximo|proximo|próxima|proxima|siguiente","noon":"mediodía|mediodia","pm":"pm|p.m.|tarde|noche","today":"hoy","tomorrow":"mañana|manana","week":"semana|semanas","yesterday":"ayer"}" data-rst-date-set ="Establecer" data-rst-date-hint ="Prueba: {example}" data-rst-date-pick ="Abrir el calendario" data-rst-date-calendar ="Calendario" data-rst-date-prev-month ="Mes anterior" data-rst-date-next-month ="Mes siguiente" data-rst-date-results ="{n} sugerencias" data-rst-date-result-one ="1 sugerencia" data-rst-date-quick-today ="Hoy" data-rst-date-quick-tomorrow ="Mañana" data-rst-date-quick-next-week ="Dentro de una semana" data-rst-date-quick-plus-1h ="Una hora después" data-rst-date-quick-plus-2h ="Dos horas después" data-rst-date-quick-end-of-day ="Final de ese día" data-rst-date-quick-next-day ="A la misma hora del día siguiente" >
<small rst-field-error id ="field-date_error-error" >Elige una fecha posterior a hoy.</small >
</div >
Con límites
Pon esto dentro de <section rst-box><form rst-form>.
<div rst-field >
<label rst-field-label for ="field-date_bounded" >Dentro de este año</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 ="{"ago":"hace","am":"am|a.m.","at":"a|las|la","day":"día|dia|días|dias","hour":"hora|horas|h","in":"en","last":"pasado|pasada|último|ultimo|última|ultima|anterior","midnight":"medianoche","minute":"minuto|minutos|min|mins|m","month":"mes|meses","next":"próximo|proximo|próxima|proxima|siguiente","noon":"mediodía|mediodia","pm":"pm|p.m.|tarde|noche","today":"hoy","tomorrow":"mañana|manana","week":"semana|semanas","yesterday":"ayer"}" data-rst-date-set ="Establecer" data-rst-date-hint ="Prueba: {example}" data-rst-date-pick ="Abrir el calendario" data-rst-date-calendar ="Calendario" data-rst-date-prev-month ="Mes anterior" data-rst-date-next-month ="Mes siguiente" data-rst-date-results ="{n} sugerencias" data-rst-date-result-one ="1 sugerencia" data-rst-date-quick-today ="Hoy" data-rst-date-quick-tomorrow ="Mañana" data-rst-date-quick-next-week ="Dentro de una semana" data-rst-date-quick-plus-1h ="Una hora después" data-rst-date-quick-plus-2h ="Dos horas después" data-rst-date-quick-end-of-day ="Final de ese día" data-rst-date-quick-next-day ="A la misma hora del día siguiente" >
</div >
Plain: el campo nativo tal cual
Sin ningún atributo de mejora, así que datetime.js no encuentra nada. El selector nativo se sigue abriendo.
Pon esto dentro de <section rst-box><form rst-form>.
<div rst-field >
<label rst-field-label for ="field-date_plain" >Publicar el</label >
<input rst-input id ="field-date_plain" name ="field-date_plain" type ="date" value ="2026-09-04" >
</div >