TimePicker-component — sgcHTML | eSeGeCe

TimePicker

TsgcHTMLComponent_TimePicker — render een native HTML5-tijdinvoer met optionele min- en max-grenzen en granulariteit tot op de seconde, in Delphi, C++ Builder en .NET.

TsgcHTMLComponent_TimePicker

Een gelabeld invoercomponent dat een Bootstrap form-control van HTML5-type time uitstuurt. Stel de grenzen in, en lees dan de HTML-eigenschap (of roep de statische helper Build aan).

Componentklasse

TsgcHTMLComponent_TimePicker

Rendert

Native HTML5 <input type="time">

Talen

Delphi, C++ Builder, .NET

Maak het aan, stel de grenzen in, render het

Stel FieldName, LabelText en de MinTime/MaxTime-grenzen in, en lees dan HTML — of roep de statische helper Build aan voor een one-liner.

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

Belangrijkste eigenschappen en methoden

De members die je het vaakst gebruikt.

Veld

Value vult de invoer vooraf in; FieldName stelt de name in; LabelText rendert een form-label.

Grenzen

MinTime en MaxTime begrenzen het selecteerbare bereik via de native min/max-attributen.

Granulariteit

StepSeconds stelt het step-attribuut rechtstreeks in; ShowSeconds (standaard False) is een snelkoppeling die granulariteit tot op de seconde aanvraagt wanneer StepSeconds op 0 blijft staan.

Validatie en status

Required en Disabled markeren de native invoer.

Grootte

Size (TsgcHTMLSize: hsExtraSmallhsExtraLarge, standaard hsMedium) koppelt aan Bootstrap's form-control-sm/form-control-lg.

Statische helper

Build(fieldName, labelText, value) retourneert de markup in één regel, zonder dat je een instantie hoeft te beheren.

Blijf ontdekken

Online helpVolledige API-referentie en gebruikshandleiding voor dit onderdeel.
Alle sgcHTML-componentenBlader door de volledige functiematrix van 80+ componenten.
Download gratis proefversieDe proefversie van 30 dagen bevat de 60.HTML-demoprojecten.
PrijzenSingle-, Team- en Site-licenties met volledige broncode.

Klaar om te beginnen?

Download de gratis proefversie en voeg datum- en tijdkiezers toe aan je Delphi-, C++ Builder- of .NET-webapp.