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