mirror of
https://github.com/goharbor/harbor.git
synced 2025-01-14 03:31:27 +01:00
fix(p2p): adjust task time format
Signed-off-by: chlins <chlins.zhang@gmail.com>
This commit is contained in:
parent
b158086642
commit
f93fc2aa0b
@ -665,16 +665,16 @@ func convertTaskToPayload(model *task.Task) (*models.Task, error) {
|
||||
}
|
||||
|
||||
return &models.Task{
|
||||
CreationTime: model.CreationTime.String(),
|
||||
EndTime: model.EndTime.String(),
|
||||
CreationTime: model.CreationTime.Format(time.RFC3339),
|
||||
EndTime: model.EndTime.Format(time.RFC3339),
|
||||
ExecutionID: model.ExecutionID,
|
||||
ExtraAttrs: model.ExtraAttrs,
|
||||
ID: model.ID,
|
||||
RunCount: model.RunCount,
|
||||
StartTime: model.StartTime.String(),
|
||||
StartTime: model.StartTime.Format(time.RFC3339),
|
||||
Status: model.Status,
|
||||
StatusMessage: model.StatusMessage,
|
||||
UpdateTime: model.UpdateTime.String(),
|
||||
UpdateTime: model.UpdateTime.Format(time.RFC3339),
|
||||
}, nil
|
||||
}
|
||||
|
||||
|
@ -375,16 +375,16 @@ func Test_convertTaskToPayload(t *testing.T) {
|
||||
EndTime: time.Time{},
|
||||
},
|
||||
expect: &models.Task{
|
||||
CreationTime: "0001-01-01 00:00:00 +0000 UTC",
|
||||
EndTime: "0001-01-01 00:00:00 +0000 UTC",
|
||||
CreationTime: "0001-01-01T00:00:00Z",
|
||||
EndTime: "0001-01-01T00:00:00Z",
|
||||
ExecutionID: 0,
|
||||
ExtraAttrs: nil,
|
||||
ID: 0,
|
||||
RunCount: 0,
|
||||
StartTime: "0001-01-01 00:00:00 +0000 UTC",
|
||||
StartTime: "0001-01-01T00:00:00Z",
|
||||
Status: "",
|
||||
StatusMessage: "",
|
||||
UpdateTime: "0001-01-01 00:00:00 +0000 UTC",
|
||||
UpdateTime: "0001-01-01T00:00:00Z",
|
||||
},
|
||||
},
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user