Changeset 602


Ignore:
Timestamp:
Jun 23, 2010, 11:21:17 AM (13 years ago)
Author:
jahn
Message:

Several minor changes and cleaning up related to date repsentations communicated with SAM.

Location:
trunk/grails-app
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/grails-app/controllers/RestController.groovy

    r600 r602  
    7171        * REST resource for the Simple Assay Module.
    7272        * Provide a list of all assays for a given study
    73         *
    74         * Example for calling this resource: http://localhost:8080/gscf/rest/getAssays/json?externalStudyID=2
     73        *
     74        * Example for calling this resource: http://localhost:8080/gscf/rest/getAssays/json?externalStudyID=2
    7575        *
    7676        * @param  externalStudyID
     
    107107                                        'subject'       : sample.parentSubject.name,
    108108                                        'event'         : sample.parentEvent.template.name,  // get the freaking name
    109                                         'startTime'     : sample.parentEvent.startTime
     109                                        'startTime'     : sample.parentEvent.getDurationString()
    110110                                ]
    111111                                items.push item
  • trunk/grails-app/domain/dbnp/studycapturing/Event.groovy

    r572 r602  
    5656        ]
    5757
    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();
    6166        }
    6267
     68
     69
    6370        /**
    64          * get a prettified duration
     71         * Get short, human readable string representing the duration between startTime and endTime
     72     *
    6573         * @return String
    6674         */
    67         static def getPrettyDuration(RelTime duration) {
    68                 return duration.toPrettyRoundedString();
     75        def getShortDuration() {
     76                return new RelTime(startTime, endTime).toPrettyRoundedString();
    6977        }
    7078
    71         def getPrettyDuration() {
    72                 getPrettyDuration(getDuration())
    73         }
    7479
    75         def getDurationString() {
    76                 def d = getDuration()
    77                 return getDuration().toPrettyString();
    78         }
    7980
    80         def getShortDuration() {
    81                 def d = getDuration()
    82                 return getDuration().toString();
    83         }
     81
     82
    8483
    8584        /**
Note: See TracChangeset for help on using the changeset viewer.