Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[REFACTOR] Pase date with kotlinx.datetime (ver 0.6.0) #708

Open
l2hyunwoo opened this issue May 26, 2024 · 0 comments
Open

[REFACTOR] Pase date with kotlinx.datetime (ver 0.6.0) #708

l2hyunwoo opened this issue May 26, 2024 · 0 comments
Labels
good first issue Good for newcomers help wanted Extra attention is needed

Comments

@l2hyunwoo
Copy link
Member

[해당 이슈는 34기 NOW SOPT Android 파트원들을 위해 제작된 오픈소스 이슈입니다]

Issue

  • kotlinx.datetime 0.6.0 버전에 Date(LocalDateTime, LocalDate, etc) 타입의 포매터가 추가되었습니다. 새로 추가된 포매터를 활용해서 현재 프로젝트 내에서 kotlinx.datetime 형식의 포맷 방식을 수정해주세요.
// AS-IS
LocalDateTime.parse(attendedAt).run {
  "${this.hour.toString().padStart(2, '0')}:${this.minute.toString().padStart(2, '0')}"
}

// TO-BE
val formatPattern = "HH:mm"
val timeFormat = LocalDateTime.Format {
    byUnicodePattern(formatPattern)
}
timeFormat.parse(LocalDateTime.parse(attendedAt))

Reference

@l2hyunwoo l2hyunwoo added good first issue Good for newcomers help wanted Extra attention is needed labels May 26, 2024
@l2hyunwoo l2hyunwoo pinned this issue May 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

1 participant