TimePicker Component — sgcHTML | eSeGeCe

TimePicker

TsgcHTMLComponent_TimePicker — render a native HTML5 time input with optional min and max bounds and second-level granularity, in Delphi, C++ Builder and .NET.

TsgcHTMLComponent_TimePicker

A labelled input component that emits a Bootstrap form-control of HTML5 type time. Set the bounds, then read the HTML property (or call the static Build helper).

Component class

TsgcHTMLComponent_TimePicker

Renders

Native HTML5 <input type="time">

Languages

Delphi, C++ Builder, .NET

Create it, set the bounds, render it

Set FieldName, LabelText and the MinTime/MaxTime bounds, then read HTML — or call the static Build helper for a 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");

Key properties & methods

The members you reach for most often.

Field

Value pre-fills the input; FieldName sets its name; LabelText renders a form-label.

Bounds

MinTime and MaxTime constrain the selectable range via the native min/max attributes.

Granularity

StepSeconds sets the step attribute directly; ShowSeconds (default False) is a shortcut that requests one-second granularity when StepSeconds is left at 0.

Validation & state

Required and Disabled flag the native input.

Sizing

Size (TsgcHTMLSize: hsExtraSmallhsExtraLarge, default hsMedium) maps onto Bootstrap's form-control-sm/form-control-lg.

Static helper

Build(fieldName, labelText, value) returns the markup in one line without managing an instance.

Keep exploring

Online HelpFull API reference and usage guide for this component.
All sgcHTML ComponentsBrowse the full feature matrix of 80+ components.
Download Free TrialThe 30-day trial ships the 60.HTML demo projects.
PricingSingle, Team and Site licenses with full source code.

Ready to Get Started?

Download the free trial and add date and time pickers to your Delphi, C++ Builder or .NET web app.