                             marginLeft: 20
                         ]
                         markdown {}, "
-                            __Task:__ #{e.task}
-                            __Duration:__ #{format_time duration}
-                            __Date:__ #{new Date(e.date).toLocaleString()}
+                            __Task:__ #{task}
+                            __Duration:__ #{format_time delta}
+                            __Date:__ #{new Date(date).toLocaleString()}
                             "
 
 

                    # overflowX: 'hidden'
                    WebkitAppRegion: 'drag'
                ]

                for i,e of final_entries
                    i = parseInt i
                    next_entry = final_entries[i + 1]
                    if next_entry? then duration = next_entry.date - e.date
                    else duration = Date.now() - e.date
                    div
                        className: 'entry'
                        style: [

        # componentWillMount: ->
        # getInitialState: ->
        render: ->
            group_entries = true # TODO: group by date?

            final_entries = []
            last_active_entry = null
            last_was_active = false
            for {active, task, date},i in log.entries
                next_entry = log.entries[i+1]
                delta = (next_entry?.date or Date.now()) - date
                if active
                    if last_active_entry?
                        if task and not last_active_entry.task
                            last_active_entry.task = task
                        if last_was_active or group_entries
                            if last_active_entry.task == task
                                last_active_entry.delta += delta
                                continue
                    last_active_entry = {delta, task, date}
                    final_entries.push last_active_entry
                last_was_active = active

            div
                id: 'main_container'
