Skip to content
This repository has been archived by the owner on Apr 4, 2024. It is now read-only.

Commit

Permalink
refactoring :: workTime 리팩토링
Browse files Browse the repository at this point in the history
  • Loading branch information
HongSJae committed Nov 6, 2023
1 parent 5423472 commit f9cff44
Showing 1 changed file with 3 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ public extension RecruitmentDetailResponseDTO {
return String(requiredGrade) + "% 이내"
}
var workTime: String {
startTime.toHoursMinutes() +
" ~ " +
endTime.toHoursMinutes()
[startTime, endTime].map {
$0.components(separatedBy: ":")[0...1].joined(separator: ":")
}.joined(separator: " ~ ")
}
return RecruitmentDetailEntity(
companyID: companyID,
Expand Down Expand Up @@ -46,9 +46,3 @@ public extension AreaResponseDTO {
)
}
}

extension String {
func toHoursMinutes() -> String {
self.components(separatedBy: ":")[0...1].joined(separator: ":")
}
}

0 comments on commit f9cff44

Please sign in to comment.