Changeset 602
- Timestamp:
- Jun 23, 2010, 11:21:17 AM (13 years ago)
- Location:
- trunk/grails-app
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/grails-app/controllers/RestController.groovy
r600 r602 71 71 * REST resource for the Simple Assay Module. 72 72 * Provide a list of all assays for a given study 73 74 73 * 74 * Example for calling this resource: http://localhost:8080/gscf/rest/getAssays/json?externalStudyID=2 75 75 * 76 76 * @param externalStudyID … … 107 107 'subject' : sample.parentSubject.name, 108 108 'event' : sample.parentEvent.template.name, // get the freaking name 109 'startTime' : sample.parentEvent. startTime109 'startTime' : sample.parentEvent.getDurationString() 110 110 ] 111 111 items.push item -
trunk/grails-app/domain/dbnp/studycapturing/Event.groovy
r572 r602 56 56 ] 57 57 58 // TODO: Jahn, could you indicate in a comment why these different duration functions exist? 59 def getDuration() { 60 return new RelTime(startTime, endTime); 58 59 /** 60 * Get extended, human readable string representing the duration between startTime and endTime 61 * 62 * @return String 63 */ 64 def getDurationString() { 65 return new RelTime(startTime, endTime).toPrettyRoundedString(); 61 66 } 62 67 68 69 63 70 /** 64 * get a prettified duration 71 * Get short, human readable string representing the duration between startTime and endTime 72 * 65 73 * @return String 66 74 */ 67 static def getPrettyDuration(RelTime duration) {68 return duration.toPrettyRoundedString();75 def getShortDuration() { 76 return new RelTime(startTime, endTime).toPrettyRoundedString(); 69 77 } 70 78 71 def getPrettyDuration() {72 getPrettyDuration(getDuration())73 }74 79 75 def getDurationString() {76 def d = getDuration()77 return getDuration().toPrettyString();78 }79 80 80 def getShortDuration() { 81 def d = getDuration() 82 return getDuration().toString(); 83 } 81 82 84 83 85 84 /**
Note: See TracChangeset
for help on using the changeset viewer.