Componente TimePicker — sgcHTML | eSeGeCe

TimePicker

TsgcHTMLComponent_TimePicker — renderiza un input de hora HTML5 nativo con límites opcionales de mínimo y máximo y granularidad de segundos, en Delphi, C++ Builder y .NET.

TsgcHTMLComponent_TimePicker

Un componente de input con etiqueta que emite un form-control de Bootstrap de tipo HTML5 time. Define los límites, y luego lee la propiedad HTML (o llama al método estático Build).

Clase del componente

TsgcHTMLComponent_TimePicker

Genera

Input de hora HTML5 nativo <input type="time">

Lenguajes

Delphi, C++ Builder, .NET

Créalo, define los límites, renderízalo

Define FieldName, LabelText y los límites MinTime/MaxTime, y luego lee HTML — o llama al método estático Build para una sola línea.

uses
  sgcHTML_Component_TimePicker;

var
  oTime: TsgcHTMLComponent_TimePicker;
begin
  oTime := TsgcHTMLComponent_TimePicker.Create(nil);
  try
    oTime.FieldName := 'appointment_time';
    oTime.LabelText := 'Appointment time';
    oTime.MinTime := '08:00';
    oTime.MaxTime := '18:00';
    oTime.Required := True;

    WebModule.Response := oTime.HTML;   // <input type="time">
  finally
    oTime.Free;
  end;
end;

// Or the static one-liner (field name, label, value):
Result := TsgcHTMLComponent_TimePicker.Build('appointment_time', 'Appointment time');
// includes: sgcHTML_Component_TimePicker.hpp

TsgcHTMLComponent_TimePicker *oTime = new TsgcHTMLComponent_TimePicker(NULL);
try
{
  oTime->FieldName = "appointment_time";
  oTime->LabelText = "Appointment time";
  oTime->MinTime = "08:00";
  oTime->MaxTime = "18:00";
  oTime->Required = true;

  String html = oTime->HTML;   // <input type="time">
}
__finally
{
  delete oTime;
}

// Or the static one-liner:
String html = TsgcHTMLComponent_TimePicker::Build("appointment_time", "Appointment time");
using esegece.sgcWebSockets;

var time = new TsgcHTMLComponent_TimePicker();
time.FieldName = "appointment_time";
time.LabelText = "Appointment time";
time.MinTime = "08:00";
time.MaxTime = "18:00";
time.Required = true;

string html = time.HTML;   // <input type="time">

// Or the static one-liner:
string html2 = TsgcHTMLComponent_TimePicker.Build("appointment_time", "Appointment time");

Propiedades y métodos clave

Los miembros que usarás con más frecuencia.

Campo

Value precarga el input; FieldName define su name; LabelText renderiza una form-label.

Límites

MinTime y MaxTime restringen el rango seleccionable mediante los atributos nativos min/max.

Granularidad

StepSeconds define el atributo step directamente; ShowSeconds (por defecto False) es un atajo que solicita granularidad de un segundo cuando StepSeconds se deja en 0.

Validación y estado

Required y Disabled marcan el input nativo.

Tamaño

Size (TsgcHTMLSize: hsExtraSmallhsExtraLarge, por defecto hsMedium) se corresponde con form-control-sm/form-control-lg de Bootstrap.

Método estático

Build(fieldName, labelText, value) devuelve el marcado en una sola línea sin gestionar una instancia.

Sigue explorando

Ayuda en líneaReferencia completa de la API y guía de uso para este componente.
Todos los componentes de sgcHTMLExplora la matriz completa de más de 80 componentes.
Descargar prueba gratuitaLa prueba de 30 días incluye los proyectos de demostración 60.HTML.
PreciosLicencias Single, Team y Site con código fuente completo.

¿Listo para empezar?

Descarga la prueba gratuita y añade selectores de fecha y hora a tu aplicación web Delphi, C++ Builder o .NET.