FORMfields


FORMfields.fields.TwentyFourHourTimeField

Class TwentyFourHourTimeField

FormField
|
+--TimeField
|
+--TwentyFourHourTimeField

public class TwentyFourHourTimeField
extends TimeField

TimeField a field for 12 hour time.

Since:
FORMfields v3.0

Field Summary
mixed

$dateFormat

The date format used when displaying the time to the user.

mixed

$subFieldDisplayValueSeparator

The string used to separate parts of the display value.

mixed

$subFieldSeparator

The string used to separate parts of the field.

Fields inherited from FORMfields.fields.TimeField
amPm, dateFormat, endTimeString, hour, min, startTimeString
Fields inherited from FORMfields.fields.FormField
autoPropagate, data, disableEnterHandler, displayValuesOnNewLine, editable, enabled, endingString, enterTabHandler, enterTabs, error, extraHtml, fieldBelowLabel, formError, help, hidden, htmlify, id, isData, label, labelForId, multiValues, name, required, subFieldDisplayValueSeparator, subFieldSeparator, subFieldValueSeparator, subFields, subFieldsCannotBeEmpty, trimWhitespace, validators, value, valueIsHtml
Constructor Summary

TwentyFourHourTimeField(string name, string label, int required, mixed startTimeString, mixed endTimeString, string the)

Creates a new TwentyFourHourTimeField.

__construct(string name, string label, int required, mixed startTimeString, mixed endTimeString, string the)

Creates a new TwentyFourHourTimeField.

Method Summary
void

get24Hour()

Returns the 24 hour value of this field's time value.

string

getEditableFieldTag()

Returns the HTML used to display the input portion of this field.

string

getValue()

Returns the value of this form field in the form "H:M"

void

setTime(array date)

Sets this field's value according to the date array returned by PHP's getdate() function.

Methods inherited from FORMfields.fields.TimeField
get24Hour, getCurrentTime, getDisplayValue, getEditableFieldTag, getUnixTimestamp, getValue, isValid, setTime, setToCurrentTime, setValue
Methods inherited from FORMfields.fields.FormField
addFieldValidator, addSubField, checkForBlank, clearValue, disable, formatRequestParameter, formatText, getButtonClicked, getData, getDbValue, getDisableFieldJs, getDisableJs, getDisableLabelJs, getDisplayFieldTag, getDisplayHtmlValue, getDisplayLabelTag, getDisplayValue, getEditable, getEditableFieldTag, getEditableLabelTag, getEnabled, getError, getExtraHtml, getFieldTag, getFormError, getHelp, getHelpTag, getHidden, getHiddenFieldTag, getId, getIsData, getIsHidden, getLabel, getLabelHtml, getLabelTag, getName, getOrNull, getParameter, getRawDbValue, getRequired, getValue, isBlank, isEmpty, isValid, setAutoPropagate, setData, setDbValue, setDisplayValuesOnNewLine, setEditable, setEnabled, setEndingString, setError, setExtraHtml, setFieldBelowLabel, setFormError, setHelp, setHidden, setHtmlify, setId, setIsData, setIsHidden, setLabel, setName, setRequired, setTrimWhitespace, setValue, setValueIsHtml, validate

Field Detail

dateFormat

public mixed $dateFormat = "G:i"

The date format used when displaying the time to the user. See PHP's date function for all the supported formats.

Since:
FORMfields v3.0

subFieldDisplayValueSeparator

public mixed $subFieldDisplayValueSeparator = ":"

The string used to separate parts of the display value.

Since:
FORMfields v3.0

subFieldSeparator

public mixed $subFieldSeparator = " : "

The string used to separate parts of the field.

Since:
FORMfields v3.0

Constructor Detail

TwentyFourHourTimeField

public TwentyFourHourTimeField(string name, string label, int required, mixed startTimeString, mixed endTimeString, string the)

Creates a new TwentyFourHourTimeField.

Parameters:
name - the name of the form field. This value must not be a SQL reserved word and should follow all the standard variable naming conventions in PHP.
label - this form field's label. The label is the printable text that is typically displayed on the left side of the field.
required - Sets whether the field must be filled in and whether it looks like it must be filled in: FORM_FIELD_REQUIRED, FORM_FIELD_NOT_REQUIRED, FORM_FIELD_LOOKS_REQUIRED or FORM_FIELD_REQUIRED_NO_LOOK
the - earliest time permitted in the form a time string define by PHP's strtotime() function. For example, "8:53 AM".
the - latest time permitted in the form a time string define by PHP's strtotime() function. For example, "6:00 PM".
See Also:
FORM_FIELD_REQUIRED
FORM_FIELD_NOT_REQUIRED
FORM_FIELD_LOOKS_REQUIRED
FORM_FIELD_REQUIRED_NO_LOOK
Since:
FORMfields v3.0
Deprecated:
deprecated as this constructor syntax is not expected in PHP 5 - will be removed once PHP 5 becomes a minimum requirement for FORMfields

Method Detail

get24Hour

public void get24Hour()

Returns the 24 hour value of this field's time value.

Since:
FORMfields v3.0

getEditableFieldTag

public string getEditableFieldTag()

Returns the HTML used to display the input portion of this field.

Returns:
the HTML used to display the input portion of this field
Since:
FORMfields v3.0

getValue

public string getValue()

Returns the value of this form field in the form "H:M"

Returns:
the value of this form field
Since:
FORMfields v3.0

setTime

public void setTime(array date)

Sets this field's value according to the date array returned by PHP's getdate() function.

Parameters:
date - the date array returned by PHP's getdate() function
Since:
FORMfields v3.0

FORMfields