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] Parse date with kotlinx.datetime (ver 0.6.0) #708

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

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

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

Comments

@l2hyunwoo
Copy link
Member

l2hyunwoo commented May 26, 2024

[해당 이슈는 35기 AND 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
@l2hyunwoo l2hyunwoo changed the title [REFACTOR] Pase date with kotlinx.datetime (ver 0.6.0) [REFACTOR] Parse date with kotlinx.datetime (ver 0.6.0) Oct 9, 2024
@t1nm1ksun
Copy link

제가 하게 되었습니다!
잘은 못하지만 열심히 해보겠습니다!!

@l2hyunwoo
Copy link
Member Author

@t1nm1ksun 네 감사합니다!

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

2 participants