       rowTotalTime = @getRowData id, "rowTotalTime"
       deletedChildrenTotalTimes = _.map deletedChildren, (x) -> x['totalTime']
       totalTimes = _.compact [rowTotalTime].concat(childTotalTimes).concat(deletedChildrenTotalTimes)
-      totalTime = sum totalTimes
+      totalTime = totalTimes.reduce (a,b) -> (a+b)
       @setRowData id, "treeTotalTime", totalTime
-
-      childDailyTimes = _.map children, (child_id) => @getRowData child_id, "treeDailyTime"
-      rowDailyTime = @getRowData id, "rowDailyTime"
-      deletedChildrenDailyTimes = _.map deletedChildren, (x) -> x['totalTime']
-      dailyTimes = _.compact [rowDailyTime].concat(childDailyTimes).concat(deletedChildrenDailyTimes)
-      dailyTime = @_combineDailyTimes.apply @, dailyTimes
-      @setRowData id, "treeDailyTime", dailyTime
 
     onRowRemoved: (event) ->
       deletedChildren = (@getRowData event.parent_id, 'deletedChildren') ? {}
       deletedChildren[event.id] = {
         totalTime: (@getRowData event.id, "treeTotalTime") ? 0
-        dailyTime: (@getRowData event.id, "treeDailyTime") ? {}
       }
       @setRowData event.parent_id, 'deletedChildren', deletedChildren
       for ancestor_id in @api.view.data.allAncestors event.id, { inclusive: false }


    onRowPeriod: (period) ->
      period.time ?= period.stop - period.start
      @transformRowData period.row, "timePeriods", (current) =>
        current ?= []
        current.push period
        current
      @_addTimeToRow period.row, period.time, period.stop
      @_addTimeToAncestors period.row, period.time, period.stop


    transformRowData: (id, keytype, transform) ->
      @setRowData id, keytype, (transform (@getRowData id, keytype))

    isLogging: () ->
      @api.getData "isLogging", true

    toggleLogging: () ->
      isLogging = do @isLogging
      @logger.info "Turning logging #{if isLogging then "off" else "on"}"
      if isLogging
        @onRowChange @api.cursor.row, null # Final close
      else
        @onRowChange null, @api.cursor.row # Initial setup
      @api.setData "isLogging", (not isLogging)
      do @api.view.render

    shouldDisplayTime: () ->
      @api.getData "display", true

    toggleDisplay: () ->
      shouldDisplay = do @shouldDisplayTime
      @logger.info "Turning display #{if shouldDisplay then "off" else "on"}"
      @api.setData "display", (not shouldDisplay)
      do @api.view.render

    onRowChange: (from, to) ->
      @logger.debug "Switching from row #{from?.id} to row #{to?.id}"
