Skip to content

Commit

Permalink
fix round seconds formatting in JobResponseMapper
Browse files Browse the repository at this point in the history
  • Loading branch information
vlad.lezhnin committed Dec 3, 2024
1 parent 7239ba3 commit e708bd1
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import java.time.Duration
import java.time.Instant
import java.time.OffsetDateTime
import java.time.ZoneId
import java.time.format.DateTimeFormatter

/**
* Mappers that help convert models from the config api to models from the public api.
Expand Down Expand Up @@ -63,10 +64,10 @@ object JobResponseMapper {
}
},
// set to string for now since the jax-rs response entity turns offsetdatetime into epoch seconds
startTime = OffsetDateTime.ofInstant(Instant.ofEpochSecond(jobRead.createdAt), UTC).toString(),
startTime = DateTimeFormatter.ISO_DATE_TIME.format(OffsetDateTime.ofInstant(Instant.ofEpochSecond(jobRead.createdAt), UTC)),
lastUpdatedAt =
if (TERMINAL_JOB_STATUS.contains(jobRead.status)) {
OffsetDateTime.ofInstant(Instant.ofEpochSecond(jobRead.updatedAt), UTC).toString()
DateTimeFormatter.ISO_DATE_TIME.format(OffsetDateTime.ofInstant(Instant.ofEpochSecond(jobRead.updatedAt), UTC))
} else {
null
},
Expand Down

0 comments on commit e708bd1

Please sign in to comment.