Skip to content

Commit f913aff

Browse files
committed
✨ Long을 Time으로 바꿔주는 BindingAdapter 추가
1 parent c06457c commit f913aff

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

presentation/src/main/java/com/whyranoid/presentation/util/BindingAdapters.kt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,3 +48,9 @@ fun TextView.finishLongToDate(long: Long) {
4848
val formatter = SimpleDateFormat("yyyy.MM.dd / HH 시 mm 분 운동 종료", Locale.KOREA)
4949
text = formatter.format(Date(long))
5050
}
51+
52+
@BindingAdapter("LongToTime")
53+
fun TextView.longToTime(long: Long) {
54+
val formatter = SimpleDateFormat("HH : mm", Locale.KOREA)
55+
text = formatter.format(Date(long))
56+
}

0 commit comments

Comments
 (0)