Changeset 698


Ignore:
Timestamp:
Jul 22, 2010, 4:39:53 PM (6 years ago)
Author:
keesvb
Message:

corrected wrong Event start time method call in RestController?

Location:
trunk/grails-app
Files:
2 edited

Legend:

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

    r693 r698  
    108108                                        'subject'             : sample.parentSubject.name,
    109109                                        'event'               : sample.parentEvent.template.name,
    110                                         'startTime'           : sample.parentEvent.getDurationString(),
     110                                        'startTime'           : sample.parentEvent.getStartTimeString(),
    111111                                        'externalSampleId': sample.externalSampleId
    112112                                ]
  • trunk/grails-app/domain/dbnp/studycapturing/Event.groovy

    r654 r698  
    1414 */
    1515class Event extends TemplateEntity implements Serializable {
    16         long startTime
    17         long endTime
     16        long startTime  // start time of the event, relative to the start time of the study
     17        long endTime    // end time of the event, relative to the start time of the study
    1818
    1919        // TODO: assure the Event has a parent study in validate()
     
    6464        def getDuration() {
    6565                return new RelTime(startTime, endTime)
     66        }
     67
     68
     69         /**
     70          * Return the start time of the event, which should be relative to the start of the study
     71          * @return String a human readable representation of the start time of the event
     72         */
     73        def getStartTimeString() {
     74                return new RelTime(startTime).toPrettyRoundedString();
    6675        }
    6776
Note: See TracChangeset for help on using the changeset viewer.