| 117 | } |
| 118 | |
| 119 | func loadWorklogInfo(task *model.Task, scanDir string) *worklogInfo { |
| 120 | // Resolve the worklog path relative to the scan directory |
| 121 | // since task.FilePath may be relative after makeFilePathsRelative |
| 122 | taskAbsPath := filepath.Join(scanDir, task.FilePath) |
| 123 | wlPath := worklog.WorklogPath(taskAbsPath, task.ID) |
| 124 | if !worklog.Exists(wlPath) { |
| 125 | return nil |
| 126 | } |
| 127 | |
| 128 | wl, err := worklog.ParseWorklog(wlPath) |
| 129 | if err != nil || len(wl.Entries) == 0 { |
| 130 | return nil |
| 131 | } |
| 132 | |
| 133 | info := &worklogInfo{ |
| 134 | EntryCount: len(wl.Entries), |
| 135 | } |
| 136 | |
| 137 | last := wl.Entries[len(wl.Entries)-1] |
| 138 | info.LastUpdated = last.Timestamp.Format("2006-01-02T15:04:05Z07:00") |
| 139 | |
| 140 | return info |
| 141 | } |
| 142 | |
| 143 | // dependencyInfo holds resolved dependency information for display. |
| 144 | type dependencyInfo struct { |