Componente TimePicker — sgcHTML | eSeGeCe

TimePicker

TsgcHTMLComponent_TimePicker — renderize um input de hora HTML5 nativo com limites opcionais de mínimo e máximo e granularidade em segundos, em Delphi, C++ Builder e .NET.

TsgcHTMLComponent_TimePicker

Um componente de input com rótulo que emite um form-control do Bootstrap do tipo HTML5 time. Defina os limites, então leia a propriedade HTML (ou chame o helper estático Build).

Classe do componente

TsgcHTMLComponent_TimePicker

Renderiza

<input type="time"> HTML5 nativo

Linguagens

Delphi, C++ Builder, .NET

Crie, defina os limites, renderize

Defina FieldName, LabelText e os limites MinTime/MaxTime, então leia HTML — ou chame o helper estático Build para uma linha única.

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");

Principais propriedades & métodos

Os membros que você usa com mais frequência.

Campo

Value pré-preenche o input; FieldName define seu name; LabelText renderiza um form-label.

Limites

MinTime e MaxTime restringem o intervalo selecionável através dos atributos nativos min/max.

Granularidade

StepSeconds define o atributo step diretamente; ShowSeconds (padrão False) é um atalho que solicita granularidade de um segundo quando StepSeconds permanece em 0.

Validação & estado

Required e Disabled sinalizam o input nativo.

Dimensionamento

Size (TsgcHTMLSize: hsExtraSmallhsExtraLarge, padrão hsMedium) corresponde ao form-control-sm/form-control-lg do Bootstrap.

Helper estático

Build(fieldName, labelText, value) retorna o markup em uma única linha, sem precisar gerenciar uma instância.

Continue explorando

Ajuda onlineReferência completa da API e guia de uso para este componente.
Todos os Componentes sgcHTMLExplore a matriz completa de recursos com mais de 80 componentes.
Baixar Versão de Avaliação GratuitaA avaliação de 30 dias inclui os projetos de demonstração 60.HTML.
PreçosLicenças Single, Team e Site com código-fonte completo.

Pronto para Começar?

Baixe a versão de avaliação gratuita e adicione seletores de data e hora à sua aplicação web Delphi, C++ Builder ou .NET.