var inputParameters = Duplicate(arguments.parameters);
var currentValue = arguments.value; // the field's current value
var readOnly = (arguments.displayMode EQ 'readonly') ? true : false;
var displayValue = "";
// Get from the App.cfc so all time fields use the same date in date/time stamp
var standardDate = application.ptCalendar.getTimeDummyDate();
// Set the Time mask to the App standard
//var cfTimeMask = application.ptCalendar.getDisplayCFtimeMask();
// Set Default Icon Options
var useClockIcon = false;
// use default displayFormat if none is spec'd
if (len(trim(inputParameters.displayFormat)) EQ 0)
inputParameters.displayFormat = "h:mm TT";
if (len(trim(currentValue)))
{
// Fix bad or incorrect date/time entries stored
currentValue = application.ptCalendar.date.csDateFormat(currentValue, currentValue);
// Strip the standardDate from the currentValueand do a TimeFormat for Display
displayValue = formatLikePlugin(trim(replace(currentValue, standardDate, "", "ALL")), inputParameters.displayFormat);
}
inputParameters = setDefaultParameters(argumentCollection=arguments);
if (inputParameters.fldIcon EQ "clock")
useClockIcon = true;
renderJSFunctions(argumentCollection=arguments,fieldParameters=inputParameters,standardDate=standardDate,useClockIcon=useClockIcon);
disabled>
var inputParameters = Duplicate(arguments.fieldParameters);
var cftTimePickerJS = '';
application.ptCalendar.scripts.addFooterJS(cftTimePickerJS,"TERTIARY");
var inputParameters = Duplicate(arguments.parameters);
// Validate if the property field has been defined
if ( NOT StructKeyExists(inputParameters, "displayFormat") OR LEN(inputParameters.displayFormat) LTE 0 )
inputParameters.displayFormat = "h:mm tt";
if ( NOT StructKeyExists(inputParameters, "uiTheme") OR LEN(inputParameters.uiTheme) LTE 0 )
inputParameters.uiTheme = application.ptCalendar.getUItheme(); // use the UI theme from the Configuration Element
if ( NOT StructKeyExists(inputParameters, "fldIcon") OR LEN(inputParameters.fldIcon) LTE 0 )
inputParameters.fldIcon = "none";
if ( NOT StructKeyExists(inputParameters, "fldID") OR LEN(inputParameters.fldID) LTE 0 )
inputParameters.fldID = TRIM(arguments.fieldName);
else
inputParameters.fldID = TRIM(inputParameters.fldID);
return inputParameters;
private any function getValidationJS(required string formName, required string fieldName, required boolean isRequired)
{
if (arguments.isRequired)
return 'hasValue(document.#arguments.formName#.#arguments.fieldName#, "TEXT")';
return "";
}
private string function getValidationMsg()
{
return "Please select a value for the #arguments.label# field.";
}
// field types that require some particular minimum height should return the desired number of pixels
public numeric function getMinHeight()
{
return 150;
}
// formats passed time using a format in the style used by the jQuery UI timepicker plugin
function formatLikePlugin(time, format)
{
var str = timeFormat(arguments.time, arguments.format);
if (find("tt", arguments.format))
str = replaceList(str, "AM,PM", "am,pm");
else if (find("t", arguments.format))
str = replaceList(str, "A,P", "a,p");
return str;
}
public string function getResourceDependencies()
{
return listAppend(super.getResourceDependencies(), "jQuery,jQueryUI,DateJS,DateFormat,jQueryUITimepickerAddon");
}
public string function loadResourceDependencies()
{
var inputParameters = setDefaultParameters(argumentCollection=arguments);
application.ptCalendar.scripts.loadJQuery();
application.ptCalendar.scripts.loadJQueryUI(themeName=inputParameters.uiTheme);
application.ptCalendar.scripts.loadDateJS();
application.ptCalendar.scripts.loadDateFormat();
application.ptCalendar.scripts.loadJQueryUITimepickerAddon();
}