Changeset 214
- Timestamp:
- Dec 4, 2009, 1:13:08 AM (15 years ago)
- Location:
- trunk/grails-app
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/grails-app/controllers/TaskDetailedController.groovy
r209 r214 10 10 def filterService 11 11 def exportService 12 def dateUtilService 12 13 13 14 // these actions only accept POST requests … … 409 410 def create = { 410 411 def taskInstance = new Task() 412 413 // Set the targetStartDate if specified, used by searchCalendar view. 414 if(params.year && params.month && params.day) 415 taskInstance.targetStartDate = dateUtilService.makeDate(params.year, params.month, params.day) 416 411 417 // Default leadPerson to current user, unless supplied in params. 412 418 taskInstance.leadPerson = personService.currentUser() -
trunk/grails-app/services/DateUtilService.groovy
r210 r214 76 76 } 77 77 78 /** 79 * Make a date object from supplied year, month, day values. 80 * The Calendar.getInstance() or Calendar.instance factory returns a new calendar instance, usually 81 * a Gregorian calendar but using Calendar we don't have to worry about those details. 82 * The time fields are set to zero and cal.getTime() or cal.time returns a java.util.Date object. 83 * @param year The year as a string or integer. 84 * @param month The month as a string or integer. 85 * @param day The day as a string or integer. 86 * @returns A Date object having the given date and all time fields set to 0, so the very start of the given day. 87 */ 88 public static Date makeDate(year, month, day) { 89 Calendar cal = Calendar.instance 90 cal.clear() 91 // Stupid month is 0-based, grumble. 92 cal.set(year.toInteger(), month.toInteger()-1, day.toInteger()) 93 cal.time 94 } 95 78 96 } -
trunk/grails-app/views/taskDetailed/create.gsp
r196 r214 51 51 </td> 52 52 <td valign="top" class="value ${hasErrors(bean:taskInstance,field:'targetStartDate','errors')}"> 53 <richui:dateChooser name="targetStartDate" format="dd-MM-yyyy" value="${ new Date()}" />53 <richui:dateChooser name="targetStartDate" format="dd-MM-yyyy" value="${taskInstance.targetStartDate}" /> 54 54 <g:helpBalloon class="helpballoon" code="task.targetStartDate" /> 55 55 </td> … … 61 61 </td> 62 62 <td valign="top" class="value ${hasErrors(bean:taskInstance,field:'targetCompletionDate','errors')}"> 63 <richui:dateChooser name="targetCompletionDate" format="dd-MM-yyyy" value="${ new Date()}" />63 <richui:dateChooser name="targetCompletionDate" format="dd-MM-yyyy" value="${taskInstance.targetCompletionDate}" /> 64 64 <g:helpBalloon class="helpballoon" code="task.targetCompletionDate" /> 65 65 </td> -
trunk/grails-app/views/taskDetailed/searchCalendar.gsp
r181 r214 38 38 <filterpane:filterButton text="Advanced" appliedText="Advanced" /> 39 39 </div> 40 <richui:calendarMonthView items="${taskInstanceList}" createLink="true" constraintDateFields="['targetStartDate']" month="${new Date()}" controller="taskDetailed" action="show" /> 40 <richui:calendarMonthView items="${taskInstanceList}" 41 createLink="true" 42 constraintDateFields="['targetStartDate']" 43 month="${new Date()}" 44 controller="taskDetailed" 45 action="show" 46 dayAction="create"/> 41 47 <filterpane:filterPane domainBean="Task" 42 48 title="Advanced Search"
Note: See TracChangeset
for help on using the changeset viewer.