Fix finished time showing for in-progress deployments
This commit is contained in:
@@ -134,23 +134,23 @@ func (d *Deployment) ShortCommit() string {
|
||||
}
|
||||
|
||||
// FinishedAtISO returns the finished time in ISO format for JavaScript parsing.
|
||||
// Falls back to started time if not finished yet.
|
||||
// Returns empty string if not finished yet.
|
||||
func (d *Deployment) FinishedAtISO() string {
|
||||
if d.FinishedAt.Valid {
|
||||
return d.FinishedAt.Time.Format(time.RFC3339)
|
||||
}
|
||||
|
||||
return d.StartedAt.Format(time.RFC3339)
|
||||
return ""
|
||||
}
|
||||
|
||||
// FinishedAtFormatted returns the finished time formatted for display.
|
||||
// Falls back to started time if not finished yet.
|
||||
// Returns empty string if not finished yet.
|
||||
func (d *Deployment) FinishedAtFormatted() string {
|
||||
if d.FinishedAt.Valid {
|
||||
return d.FinishedAt.Time.Format("2006-01-02 15:04:05")
|
||||
}
|
||||
|
||||
return d.StartedAt.Format("2006-01-02 15:04:05")
|
||||
return ""
|
||||
}
|
||||
|
||||
func (d *Deployment) insert(ctx context.Context) error {
|
||||
|
||||
Reference in New Issue
Block a user