Skip to content

Commit

Permalink
internal/v1: ISO8601 datetime
Browse files Browse the repository at this point in the history
Return an ISO8601 compliant datetime to facilitate
easier parsing and comparison in the frontend.

Addresses #457
  • Loading branch information
kingsleyzissou authored and croissanne committed Oct 31, 2022
1 parent ff80916 commit 67690e5
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions internal/v1/handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -363,7 +363,7 @@ func (h *Handlers) GetComposes(ctx echo.Context, params GetComposesParams) error
var data []ComposesResponseItem
for _, c := range composes {
data = append(data, ComposesResponseItem{
CreatedAt: c.CreatedAt.String(),
CreatedAt: c.CreatedAt.Format(time.RFC3339),
Id: c.Id.String(),
ImageName: c.ImageName,
Request: c.Request,
Expand Down Expand Up @@ -881,7 +881,7 @@ func (h *Handlers) GetComposeClones(ctx echo.Context, composeId string, params G
data = append(data, ClonesResponseItem{
Id: c.Id.String(),
Request: c.Request,
CreatedAt: c.CreatedAt.String(),
CreatedAt: c.CreatedAt.Format(time.RFC3339),
})
}

Expand Down
2 changes: 1 addition & 1 deletion internal/v1/server_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -535,7 +535,7 @@ func TestGetComposes(t *testing.T) {
require.NoError(t, err)

require.Equal(t, 3, result.Meta.Count)
require.Equal(t, composeEntry.CreatedAt.String(), result.Data[0].CreatedAt)
require.Equal(t, composeEntry.CreatedAt.Format(time.RFC3339), result.Data[0].CreatedAt)
require.Equal(t, UUIDTest, result.Data[0].Id)
}

Expand Down

0 comments on commit 67690e5

Please sign in to comment.