File tree 2 files changed +6
-8
lines changed
java/org/seemeet/seemeet/util
2 files changed +6
-8
lines changed Original file line number Diff line number Diff line change @@ -6,9 +6,7 @@ import android.widget.TextView
6
6
import androidx.annotation.ColorRes
7
7
import androidx.annotation.DrawableRes
8
8
import androidx.core.content.ContextCompat
9
- import java.time.DayOfWeek
10
- import java.time.LocalDate
11
- import java.time.LocalDateTime
9
+ import java.time.*
12
10
import java.time.format.DateTimeFormatter
13
11
import java.time.temporal.ChronoUnit
14
12
import java.time.temporal.WeekFields
@@ -89,10 +87,11 @@ fun String.monthDayParsing() : String {
89
87
return " ${date[1 ]} 월 ${date[2 ]} 일"
90
88
}
91
89
fun String.calDday () : Int {
92
- val today = LocalDate .now().dayOfMonth
93
- val date = this .split(" -" )[2 ].toInt()
90
+ val comeDay = LocalDate .parse(this , DateTimeFormatter .ISO_DATE ).atStartOfDay().toInstant(
91
+ ZoneOffset .of(" +9" ))
92
+ val today = LocalDateTime .now().toInstant( ZoneOffset .of(" +9" ))
94
93
95
- return date - today
94
+ return ChronoUnit . DAYS .between( today, comeDay).toInt()
96
95
}
97
96
98
97
fun String.dateParsingIso () : LocalDateTime {
@@ -112,4 +111,3 @@ fun String.setBetweenDays2() : Long {
112
111
113
112
return ChronoUnit .DAYS .between(created, today)
114
113
}
115
-
Original file line number Diff line number Diff line change 60
60
<string name =" noti_in_progress" >진행 중</string >
61
61
<string name =" noti_done" >완료</string >
62
62
<string name =" noti_send" >보낸 요청</string >
63
- <string name =" noti_day" >1일전 </string >
63
+ <string name =" noti_day" >0일전 </string >
64
64
<string name =" noti_send_msg_wait" >친구</string >
65
65
<string name =" noti_send_msg_wait_num" >3</string >
66
66
<string name =" noti_send_msg_wait2" >명의 답변을 기다리고 있어요!</string >
You can’t perform that action at this time.
0 commit comments