PageRenderTime 23ms CodeModel.GetById 13ms app.highlight 5ms RepoModel.GetById 1ms app.codeStats 0ms

/wheels/view/formsdateplain.cfm

http://raihan.googlecode.com/
ColdFusion | 412 lines | 397 code | 15 blank | 0 comment | 136 complexity | 5f1a17d488802dce17e1acd1219cb287 MD5 | raw file
  1<cffunction name="dateSelectTags" returntype="string" access="public" output="false" hint="Builds and returns a string containing three select form controls (month, day, and year) based on a `name` and `value`."
  2	examples=
  3	'
  4		<!--- This "Tag" version of function accepts `name` and `selected` instead of binding to a model object --->
  5		<cfoutput>
  6			##dateSelectTags(name="dateStart", selected=params.dateStart)##
  7		</cfoutput>
  8		
  9		<!--- Show fields for month and year only --->
 10		<cfoutput>
 11			##dateSelectTags(name="expiration", selected=params.expiration, order="month,year")##
 12		</cfoutput>
 13	'
 14	categories="view-helper,forms-plain" chapters="form-helpers-and-showing-errors" functions="URLFor,startFormTag,endFormTag,textFieldTag,submitTag,radioButtonTag,checkBoxTag,passwordFieldTag,hiddenFieldTag,textAreaTag,fileFieldTag,selectTag,dateTimeSelectTags,timeSelectTags">
 15	<cfargument name="name" type="string" required="true" hint="See documentation for @textFieldTag.">
 16	<cfargument name="selected" type="string" required="false" default="" hint="See documentation for @selectTag.">
 17	<cfargument name="order" type="string" required="false" hint="See documentation for @dateSelect.">
 18	<cfargument name="separator" type="string" required="false" hint="See documentation for @dateSelect.">
 19	<cfargument name="startYear" type="numeric" required="false" hint="See documentation for @dateSelect.">
 20	<cfargument name="endYear" type="numeric" required="false" hint="See documentation for @dateSelect.">
 21	<cfargument name="monthDisplay" type="string" required="false" hint="See documentation for @dateSelect.">
 22	<cfargument name="includeBlank" type="any" required="false" hint="See documentation for @select.">
 23	<cfargument name="label" type="string" required="false" hint="See documentation for @dateSelect.">
 24	<cfargument name="labelPlacement" type="string" required="false" hint="See documentation for @textField.">
 25	<cfargument name="prepend" type="string" required="false" hint="See documentation for @textField.">
 26	<cfargument name="append" type="string" required="false" hint="See documentation for @textField.">
 27	<cfargument name="prependToLabel" type="string" required="false" hint="See documentation for @textField.">
 28	<cfargument name="appendToLabel" type="string" required="false" hint="See documentation for @textField.">
 29	<cfargument name="combine" type="boolean" required="false" hint="See documentation for @dateSelect.">
 30	<cfargument name="$now" type="date" required="false" default="#now()#">
 31	<cfscript>
 32		$args(name="dateSelectTags", args=arguments);
 33		arguments.property = arguments.name;
 34		arguments.objectName = {};
 35		arguments.objectName[arguments.name] = arguments.selected;
 36		StructDelete(arguments, "name");
 37		StructDelete(arguments, "selected");
 38		arguments.$functionName = "dateSelectTag";
 39	</cfscript>
 40	<cfreturn $dateOrTimeSelect(argumentCollection=arguments)>
 41</cffunction>
 42
 43<cffunction name="timeSelectTags" returntype="string" access="public" output="false" hint="Builds and returns a string containing three select form controls for hour, minute, and second based on `name`."
 44	examples=
 45	'
 46		<!--- This "Tag" version of function accepts `name` and `selected` instead of binding to a model object --->
 47		<cfoutput>
 48		    ##timeSelectTags(name="timeOfMeeting" selected=params.timeOfMeeting)##
 49		</cfoutput>
 50		
 51		<!--- Show fields for `hour` and `minute` only --->
 52		<cfoutput>
 53			##timeSelectTags(name="timeOfMeeting", selected=params.timeOfMeeting, order="hour,minute")##
 54		</cfoutput>
 55	'
 56	categories="view-helper,forms-plain" chapters="form-helpers-and-showing-errors" functions="URLFor,startFormTag,endFormTag,submitTag,textFieldTag,radioButtonTag,checkBoxTag,passwordFieldTag,hiddenFieldTag,textAreaTag,fileFieldTag,selectTag,dateTimeSelectTags,dateSelectTags">
 57	<cfargument name="name" type="string" required="true" hint="See documentation for @textFieldTag.">
 58	<cfargument name="selected" type="string" required="false" default="" hint="See documentation for @selectTag.">
 59	<cfargument name="order" type="string" required="false" hint="See documentation for @timeSelect.">
 60	<cfargument name="separator" type="string" required="false" hint="See documentation for @timeSelect.">
 61	<cfargument name="minuteStep" type="numeric" required="false" hint="See documentation for @timeSelect.">
 62	<cfargument name="secondStep" type="numeric" required="false" hint="See documentation for @timeSelect.">
 63	<cfargument name="includeBlank" type="any" required="false" hint="See documentation for @select.">
 64	<cfargument name="label" type="string" required="false" hint="See documentation for @dateSelect.">
 65	<cfargument name="labelPlacement" type="string" required="false" hint="See documentation for @textField.">
 66	<cfargument name="prepend" type="string" required="false" hint="See documentation for @textField.">
 67	<cfargument name="append" type="string" required="false" hint="See documentation for @textField.">
 68	<cfargument name="prependToLabel" type="string" required="false" hint="See documentation for @textField.">
 69	<cfargument name="appendToLabel" type="string" required="false" hint="See documentation for @textField.">
 70	<cfargument name="combine" type="boolean" required="false" hint="See documentation for @dateSelect.">
 71	<cfargument name="twelveHour" type="boolean" required="false" default="false" hint="See documentation for @timeSelect.">
 72	<cfscript>
 73		$args(name="timeSelectTags", args=arguments);
 74		arguments.property = arguments.name;
 75		arguments.objectName = {};
 76		arguments.objectName[arguments.name] = arguments.selected;
 77		StructDelete(arguments, "name");
 78		StructDelete(arguments, "selected");
 79		arguments.$functionName = "timeSelectTag";
 80	</cfscript>
 81	<cfreturn $dateOrTimeSelect(argumentCollection=arguments)>
 82</cffunction>
 83
 84<cffunction name="dateTimeSelectTags" returntype="string" access="public" output="false" hint="Builds and returns a string containing six select form controls (three for date selection and the remaining three for time selection) based on a `name`."
 85	examples=
 86	'
 87		<!--- This "Tag" version of the function accepts a `name` and `selected` instead of binding to a model object --->
 88		<cfoutput>
 89		    ##dateTimeSelectTags(name="dateTimeStart", selected=params.dateTimeStart)##
 90		</cfoutput>
 91		
 92		<!--- Show fields for month, day, hour, and minute --->
 93		<cfoutput>
 94			##dateTimeSelectTags(name="dateTimeStart", selected=params.dateTimeStart, dateOrder="month,day", timeOrder="hour,minute")##
 95		</cfoutput>
 96	'
 97	categories="view-helper,forms-plain" chapters="form-helpers-and-showing-errors" functions="URLFor,startFormTag,endFormTag,submitTag,textFieldTag,radioButtonTag,checkBoxTag,passwordFieldTag,hiddenFieldTag,textAreaTag,fileFieldTag,selectTag,dateSelectTags,timeSelectTags">
 98	<cfargument name="name" type="string" required="true" hint="See documentation for @textFieldTag.">
 99	<cfargument name="selected" type="string" required="false" default="" hint="See documentation for @selectTag.">
100	<cfargument name="dateOrder" type="string" required="false" hint="See documentation for @dateTimeSelect.">
101	<cfargument name="dateSeparator" type="string" required="false" hint="See documentation for @dateTimeSelect.">
102	<cfargument name="startYear" type="numeric" required="false" hint="See documentation for @dateSelect.">
103	<cfargument name="endYear" type="numeric" required="false" hint="See documentation for @dateSelect.">
104	<cfargument name="monthDisplay" type="string" required="false" hint="See documentation for @dateSelect.">
105	<cfargument name="timeOrder" type="string" required="false" hint="See documentation for @dateTimeSelect.">
106	<cfargument name="timeSeparator" type="string" required="false" hint="See documentation for @dateTimeSelect.">
107	<cfargument name="minuteStep" type="numeric" required="false" hint="See documentation for @timeSelect.">
108	<cfargument name="secondStep" type="numeric" required="false" hint="See documentation for @timeSelect.">
109	<cfargument name="separator" type="string" required="false" hint="See documentation for @dateTimeSelect.">
110	<cfargument name="includeBlank" type="any" required="false" hint="See documentation for @select.">
111	<cfargument name="label" type="string" required="false" hint="See documentation for @dateSelect.">
112	<cfargument name="labelPlacement" type="string" required="false" hint="See documentation for @textField.">
113	<cfargument name="prepend" type="string" required="false" hint="See documentation for @textField.">
114	<cfargument name="append" type="string" required="false" hint="See documentation for @textField.">
115	<cfargument name="prependToLabel" type="string" required="false" hint="See documentation for @textField.">
116	<cfargument name="appendToLabel" type="string" required="false" hint="See documentation for @textField.">
117	<cfargument name="combine" type="boolean" required="false" hint="See documentation for @dateSelect.">
118	<cfargument name="twelveHour" type="boolean" required="false" default="false" hint="See documentation for @timeSelect.">
119	<cfscript>
120		var loc = {};
121		$args(name="dateTimeSelectTags", args=arguments);
122		loc.returnValue = "";
123		loc.separator = arguments.separator;
124		loc.label = arguments.label;
125
126		// create date portion
127		arguments.order = arguments.dateOrder;
128		arguments.separator = arguments.dateSeparator;
129		// when a list of 6 elements has been passed in as labels we assume the first 3 are meant to be placed on the date related tags
130		if (ListLen(loc.label) == 6)
131			arguments.label = ListGetAt(loc.label, 1) & "," & ListGetAt(loc.label, 2) & "," & ListGetAt(loc.label, 3);
132		if (StructKeyExists(arguments, "$functionName") && arguments.$functionName == "dateTimeSelect")
133			loc.returnValue = loc.returnValue & dateSelect(argumentCollection=arguments);
134		else
135			loc.returnValue = loc.returnValue & dateSelectTags(argumentCollection=arguments);
136
137		// separate date and time with a string ("-" by default)
138		loc.returnValue = loc.returnValue & loc.separator;
139
140		// create time portion
141		arguments.order = arguments.timeOrder;
142		arguments.separator = arguments.timeSeparator;
143		// when a list of 6 elements has been passed in as labels we assume the last 3 are meant to be placed on the time related tags
144		if (ListLen(loc.label) == 6)
145			arguments.label = ListGetAt(loc.label, 4) & "," & ListGetAt(loc.label, 5) & "," & ListGetAt(loc.label, 6);
146		if (StructKeyExists(arguments, "$functionName") && arguments.$functionName == "dateTimeSelect")
147			loc.returnValue = loc.returnValue & timeSelect(argumentCollection=arguments);
148		else
149			loc.returnValue = loc.returnValue & timeSelectTags(argumentCollection=arguments);
150	</cfscript>
151	<cfreturn loc.returnValue>
152</cffunction>
153
154<cffunction name="yearSelectTag" returntype="string" access="public" output="false" hint="Builds and returns a string containing a select form control for a range of years based on the supplied `name`."
155	examples=
156	'
157		<!--- View code --->
158		<cfoutput>
159		    ##yearSelectTag(name="yearOfBirthday", selected=params.yearOfBirthday)##
160		</cfoutput>
161		
162		<!--- Only allow selection of year to be for the past 50 years, minimum being 18 years ago --->
163		<cfset fiftyYearsAgo = Now() - 50>
164		<cfset eighteenYearsAgo = Now() - 18>
165		<cfoutput>
166			##yearSelectTag(name="yearOfBirthday", selected=params.yearOfBirthday, startYear=fiftyYearsAgo, endYear=eighteenYearsAgo)##
167		</cfoutput>
168	'
169	categories="view-helper,forms-plain" chapters="form-helpers-and-showing-errors" functions="URLFor,startFormTag,endFormTag,submitTag,textFieldTag,radioButtonTag,checkBoxTag,passwordFieldTag,hiddenFieldTag,textAreaTag,fileFieldTag,selectTag,dateTimeSelectTags,dateSelectTags,timeSelectTags">
170	<cfargument name="name" type="string" required="true" hint="See documentation for @textFieldTag.">
171	<cfargument name="selected" type="string" required="false" default="" hint="The year that should be selected initially.">
172	<cfargument name="startYear" type="numeric" required="false" hint="See documentation for @dateSelect.">
173	<cfargument name="endYear" type="numeric" required="false" hint="See documentation for @dateSelect.">
174	<cfargument name="includeBlank" type="any" required="false" hint="See documentation for @select.">
175	<cfargument name="label" type="string" required="false" hint="See documentation for @textField.">
176	<cfargument name="labelPlacement" type="string" required="false" hint="See documentation for @textField.">
177	<cfargument name="prepend" type="string" required="false" hint="See documentation for @textField.">
178	<cfargument name="append" type="string" required="false" hint="See documentation for @textField.">
179	<cfargument name="prependToLabel" type="string" required="false" hint="See documentation for @textField.">
180	<cfargument name="appendToLabel" type="string" required="false" hint="See documentation for @textField.">
181	<cfargument name="$now" type="date" required="false" default="#now()#">
182	<cfscript>
183		$args(name="yearSelectTag", args=arguments);
184		if (IsNumeric(arguments.selected))
185		{
186			arguments.selected = $dateForSelectTags("year", arguments.selected, arguments.$now);
187		}
188		arguments.order = "year";
189	</cfscript>
190	<cfreturn dateSelectTags(argumentCollection=arguments)>
191</cffunction>
192
193<cffunction name="monthSelectTag" returntype="string" access="public" output="false" hint="Builds and returns a string containing a select form control for the months of the year based on the supplied `name`."
194	examples=
195	'
196		<!--- This "Tag" version of the function accepts a `name` and `selected` instead of binding to a model object --->
197		<cfoutput>
198		    ##monthSelectTag(name="monthOfBirthday", selected=params.monthOfBirthday)##
199		</cfoutput>
200	'
201	categories="view-helper,forms-plain" chapters="form-helpers-and-showing-errors" functions="URLFor,startFormTag,endFormTag,submitTag,textFieldTag,radioButtonTag,checkBoxTag,passwordFieldTag,hiddenFieldTag,textAreaTag,fileFieldTag,selectTag,dateTimeSelectTags,dateSelectTags,timeSelectTags">
202	<cfargument name="name" type="string" required="true" hint="See documentation for @textFieldTag.">
203	<cfargument name="selected" type="string" required="false" default="" hint="The month that should be selected initially.">
204	<cfargument name="monthDisplay" type="string" required="false" hint="See documentation for @dateSelect.">
205	<cfargument name="includeBlank" type="any" required="false" hint="See documentation for @select.">
206	<cfargument name="label" type="string" required="false" hint="See documentation for @textField.">
207	<cfargument name="labelPlacement" type="string" required="false" hint="See documentation for @textField.">
208	<cfargument name="prepend" type="string" required="false" hint="See documentation for @textField.">
209	<cfargument name="append" type="string" required="false" hint="See documentation for @textField.">
210	<cfargument name="prependToLabel" type="string" required="false" hint="See documentation for @textField.">
211	<cfargument name="appendToLabel" type="string" required="false" hint="See documentation for @textField.">
212	<cfargument name="$now" type="date" required="false" default="#now()#">
213	<cfscript>
214		var loc = {};
215		$args(name="monthSelectTag", args=arguments);
216		if (IsNumeric(arguments.selected) and IsValid("range", arguments.selected, 0, 12))
217		{
218			arguments.selected = $dateForSelectTags("month", arguments.selected, arguments.$now);
219		}
220		arguments.order = "month";
221	</cfscript>
222	<cfreturn dateSelectTags(argumentCollection=arguments)>
223</cffunction>
224
225<cffunction name="daySelectTag" returntype="string" access="public" output="false" hint="Builds and returns a string containing a select form control for the days of the week based on the supplied `name`."
226	examples=
227	'
228		<!--- This "Tag" version of the function accepts a `name` and `selected` instead of binding to a model object --->
229		<cfoutput>
230		    ##daySelectTag(name="dayOfWeek", selected=params.dayOfWeek)##
231		</cfoutput>
232	'
233	categories="view-helper,forms-plain" chapters="form-helpers-and-showing-errors" functions="URLFor,startFormTag,endFormTag,submitTag,textFieldTag,radioButtonTag,checkBoxTag,passwordFieldTag,hiddenFieldTag,textAreaTag,fileFieldTag,selectTag,dateTimeSelectTags,dateSelectTags,timeSelectTags">
234	<cfargument name="name" type="string" required="true" hint="See documentation for @textFieldTag.">
235	<cfargument name="selected" type="string" required="false" default="" hint="The day that should be selected initially.">
236	<cfargument name="includeBlank" type="any" required="false" hint="See documentation for @select.">
237	<cfargument name="label" type="string" required="false" hint="See documentation for @textField.">
238	<cfargument name="labelPlacement" type="string" required="false" hint="See documentation for @textField.">
239	<cfargument name="prepend" type="string" required="false" hint="See documentation for @textField.">
240	<cfargument name="append" type="string" required="false" hint="See documentation for @textField.">
241	<cfargument name="prependToLabel" type="string" required="false" hint="See documentation for @textField.">
242	<cfargument name="appendToLabel" type="string" required="false" hint="See documentation for @textField.">
243	<cfargument name="$now" type="date" required="false" default="#now()#">
244	<cfscript>
245		$args(name="daySelectTag", args=arguments);
246		if (IsNumeric(arguments.selected) and IsValid("range", arguments.selected, 0, 31))
247		{
248			arguments.selected = $dateForSelectTags("day", arguments.selected, arguments.$now);
249		}
250		arguments.order = "day";
251	</cfscript>
252	<cfreturn dateSelectTags(argumentCollection=arguments)>
253</cffunction>
254
255<cffunction name="hourSelectTag" returntype="string" access="public" output="false" hint="Builds and returns a string containing one select form control for the hours of the day based on the supplied `name`."
256	examples=
257	'
258		<!--- This "Tag" version of the function accepts a `name` and `selected` instead of binding to a model object --->
259		<cfoutput>
260		    ##hourSelectTag(name="hourOfMeeting", selected=params.hourOfMeeting)##
261		</cfoutput>
262		
263		<!--- Show 12 hours instead of 24 --->
264		<cfoutput>
265			##hourSelectTag(name="hourOfMeeting", selected=params.hourOfMeeting, twelveHour=true)##
266		</cfoutput>
267	'
268	categories="view-helper,forms-plain" chapters="form-helpers-and-showing-errors" functions="URLFor,startFormTag,endFormTag,submitTag,textFieldTag,radioButtonTag,checkBoxTag,passwordFieldTag,hiddenFieldTag,textAreaTag,fileFieldTag,selectTag,dateTimeSelectTags,dateSelectTags,timeSelectTags">
269	<cfargument name="name" type="string" required="true" hint="See documentation for @textFieldTag.">
270	<cfargument name="selected" type="string" required="false" default="" hint="The hour that should be selected initially.">
271	<cfargument name="includeBlank" type="any" required="false" hint="See documentation for @select.">
272	<cfargument name="label" type="string" required="false" hint="See documentation for @textField.">
273	<cfargument name="labelPlacement" type="string" required="false" hint="See documentation for @textField.">
274	<cfargument name="prepend" type="string" required="false" hint="See documentation for @textField.">
275	<cfargument name="append" type="string" required="false" hint="See documentation for @textField.">
276	<cfargument name="prependToLabel" type="string" required="false" hint="See documentation for @textField.">
277	<cfargument name="appendToLabel" type="string" required="false" hint="See documentation for @textField.">
278	<cfargument name="twelveHour" type="boolean" required="false" default="false" hint="See documentation for @timeSelect.">
279	<cfargument name="$now" type="date" required="false" default="#now()#">
280	<cfscript>
281		$args(name="hourSelectTag", args=arguments);
282		if (IsNumeric(arguments.selected) and arguments.selected gte 0 and arguments.selected lt 60)
283			arguments.selected = createTime(arguments.selected, Minute(arguments.$now), Second(arguments.$now));
284		arguments.order = "hour";
285	</cfscript>
286	<cfreturn timeSelectTags(argumentCollection=arguments)>
287</cffunction>
288
289<cffunction name="minuteSelectTag" returntype="string" access="public" output="false" hint="Builds and returns a string containing one select form control for the minutes of an hour based on the supplied `name`."
290	examples=
291	'
292		<!--- This "Tag" version of the function accepts a `name` and `selected` instead of binding to a model object --->
293		<cfoutput>
294		    ##minuteSelectTag(name="minuteOfMeeting", value=params.minuteOfMeeting)##
295		</cfoutput>
296		
297		<!--- Only show 15-minute intervals --->
298		<cfoutput>
299			##minuteSelectTag(name="minuteOfMeeting", value=params.minuteOfMeeting, minuteStep=15)##
300		</cfoutput>
301	'
302	categories="view-helper,forms-plain" chapters="form-helpers-and-showing-errors" functions="URLFor,startFormTag,endFormTag,submitTag,textFieldTag,radioButtonTag,checkBoxTag,passwordFieldTag,hiddenFieldTag,textAreaTag,fileFieldTag,selectTag,dateTimeSelectTags,dateSelectTags,timeSelectTags">
303	<cfargument name="name" type="string" required="true" hint="See documentation for @textFieldTag.">
304	<cfargument name="selected" type="string" required="false" default="" hint="The minute that should be selected initially.">
305	<cfargument name="minuteStep" type="numeric" required="false" hint="See documentation for @timeSelect.">
306	<cfargument name="includeBlank" type="any" required="false" hint="See documentation for @select.">
307	<cfargument name="label" type="string" required="false" hint="See documentation for @textField.">
308	<cfargument name="labelPlacement" type="string" required="false" hint="See documentation for @textField.">
309	<cfargument name="prepend" type="string" required="false" hint="See documentation for @textField.">
310	<cfargument name="append" type="string" required="false" hint="See documentation for @textField.">
311	<cfargument name="prependToLabel" type="string" required="false" hint="See documentation for @textField.">
312	<cfargument name="appendToLabel" type="string" required="false" hint="See documentation for @textField.">
313	<cfargument name="$now" type="date" required="false" default="#now()#">
314	<cfscript>
315		$args(name="minuteSelectTag", args=arguments);
316		if (IsNumeric(arguments.selected) and arguments.selected gte 0 and arguments.selected lt 60)
317		{
318			arguments.selected = createTime(Hour(arguments.$now), arguments.selected, Second(arguments.$now));
319		}
320		arguments.order = "minute";
321	</cfscript>
322	<cfreturn timeSelectTags(argumentCollection=arguments)>
323</cffunction>
324
325<cffunction name="secondSelectTag" returntype="string" access="public" output="false" hint="Builds and returns a string containing one select form control for the seconds of a minute based on the supplied `name`."
326	examples=
327	'
328		<!--- This "Tag" version of the function accepts a `name` and `selected` instead of binding to a model object --->
329		<cfoutput>
330		    ##secondSelectTag(name="secondsToLaunch", selected=params.secondsToLaunch)##
331		</cfoutput>
332		
333		<!--- Only show 15-second intervals --->
334		<cfoutput>
335			##secondSelectTag(name="secondsToLaunch", value=params.secondsToLaunch, secondStep=15)##
336		</cfoutput>
337	'
338	categories="view-helper,forms-plain" chapters="form-helpers-and-showing-errors" functions="URLFor,startFormTag,endFormTag,submitTag,textFieldTag,radioButtonTag,checkBoxTag,passwordFieldTag,hiddenFieldTag,textAreaTag,fileFieldTag,selectTag,dateTimeSelectTags,dateSelectTags,timeSelectTags">
339	<cfargument name="name" type="string" required="true" hint="See documentation for @textFieldTag.">
340	<cfargument name="selected" type="string" required="false" default="" hint="The second that should be selected initially.">
341	<cfargument name="secondStep" type="numeric" required="false" hint="See documentation for @timeSelect.">
342	<cfargument name="includeBlank" type="any" required="false" hint="See documentation for @select.">
343	<cfargument name="label" type="string" required="false" hint="See documentation for @textField.">
344	<cfargument name="labelPlacement" type="string" required="false" hint="See documentation for @textField.">
345	<cfargument name="prepend" type="string" required="false" hint="See documentation for @textField.">
346	<cfargument name="append" type="string" required="false" hint="See documentation for @textField.">
347	<cfargument name="prependToLabel" type="string" required="false" hint="See documentation for @textField.">
348	<cfargument name="appendToLabel" type="string" required="false" hint="See documentation for @textField.">
349	<cfargument name="$now" type="date" required="false" default="#now()#">
350	<cfscript>
351		$args(name="secondSelectTag", args=arguments);
352		if (IsNumeric(arguments.selected) and arguments.selected gte 0 and arguments.selected lt 60)
353			arguments.selected = createTime(Hour(arguments.$now), Minute(arguments.$now), arguments.selected);
354		arguments.order = "second";
355	</cfscript>
356	<cfreturn timeSelectTags(argumentCollection=arguments)>
357</cffunction>
358
359<cffunction name="$dateForSelectTags" returntype="date" access="public" output="false">
360	<cfargument name="part" type="string" required="true">
361	<cfargument name="value" type="numeric" required="true">
362	<cfargument name="$now" type="date" required="true">
363	<cfscript>
364	var loc = {};
365	loc._year = year(arguments.$now);
366	loc._month = month(arguments.$now);
367	loc._day = day(arguments.$now);
368	loc.ret = arguments.$now;
369	
370	switch(arguments.part)
371	{
372		case "year":
373		{
374			loc._year = arguments.value;
375			break;
376		}
377		case "month":
378		{
379			loc._month = arguments.value;
380			break;
381		}
382		case "day":
383		{
384			loc._day = arguments.value;
385			break;
386		}
387	}
388	
389	// handle febuary
390	if (loc._month eq 2 && ((!IsLeapYear(loc._year) && loc._day gt 29) || (IsLeapYear(loc._year) && loc._day gt 28)))
391	{
392		if (IsLeapYear(loc._year))
393		{
394			loc._day = 29;
395		}
396		else
397		{
398			loc._day = 28;
399		}
400	}
401	
402	try
403	{
404		loc.ret = createDate(loc._year, loc._month, loc._day);
405	}
406	catch (Any e)
407	{
408		loc.ret = arguments.$now;
409	}
410	</cfscript>
411	<cfreturn loc.ret>
412</cffunction>