Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
package com.poti.android.core.common.extension

import java.time.LocalDateTime
import java.time.format.DateTimeFormatter
import java.time.format.DateTimeParseException

fun String.toPartyUploadDate(): String? {
return try {
val dateTime = LocalDateTime.parse(this)
val formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd")
dateTime.format(formatter)
} catch (_: DateTimeParseException) {
null
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ data class PartyDetail(
val artistId: Long, // 아티스트 아이디
val title: String, // 분철글 제목
val price: Int, // 1인당 가격 (원)
val uploadTime: String, // 업로드 시간 (예: "4시간 전")
val uploadTime: String, // 업로드 시간 (예: "2026-01-22T06:21:20.697608")
val deadline: String, // 모집 마감일
val images: List<PartyImage>, // 상품 이미지 리스트
val content: String, // 분철글 본문 내용
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import androidx.compose.ui.tooling.preview.Preview
import androidx.compose.ui.unit.dp
import com.poti.android.R
import com.poti.android.core.common.extension.toMoneyString
import com.poti.android.core.common.extension.toPartyUploadDate
import com.poti.android.core.designsystem.component.button.PotiIconButton
import com.poti.android.core.designsystem.theme.PotiTheme
import com.poti.android.domain.model.party.PartyDetail
Expand Down Expand Up @@ -65,7 +66,7 @@ fun PartyDetailHeaderInfo(
}

Text(
text = partyDetail.uploadTime,
text = stringResource(R.string.party_detail_upload_date_label, (partyDetail.uploadTime.toPartyUploadDate() ?: "")),
style = PotiTheme.typography.body14m,
color = PotiTheme.colors.gray800,
)
Comment on lines 68 to 72
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

파싱 실패 시 ‘등록’만 노출되는 UI를 막아주세요.

현재 ?: ""로 인해 날짜 파싱 실패 시 “등록”만 표시됩니다. null일 때는 해당 Text를 숨기거나 원본 문자열로 fallback하는 쪽이 안전합니다.

🔧 숨김 처리 예시
-            Text(
-                text = stringResource(R.string.party_detail_upload_date_label, (partyDetail.uploadTime.toPartyUploadDate() ?: "")),
-                style = PotiTheme.typography.body14m,
-                color = PotiTheme.colors.gray800,
-            )
+            val uploadDate = partyDetail.uploadTime.toPartyUploadDate()
+            if (uploadDate != null) {
+                Text(
+                    text = stringResource(R.string.party_detail_upload_date_label, uploadDate),
+                    style = PotiTheme.typography.body14m,
+                    color = PotiTheme.colors.gray800,
+                )
+            }
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
Text(
text = partyDetail.uploadTime,
text = stringResource(R.string.party_detail_upload_date_label, (partyDetail.uploadTime.toPartyUploadDate() ?: "")),
style = PotiTheme.typography.body14m,
color = PotiTheme.colors.gray800,
)
val uploadDate = partyDetail.uploadTime.toPartyUploadDate()
if (uploadDate != null) {
Text(
text = stringResource(R.string.party_detail_upload_date_label, uploadDate),
style = PotiTheme.typography.body14m,
color = PotiTheme.colors.gray800,
)
}
🤖 Prompt for AI Agents
In
`@app/src/main/java/com/poti/android/presentation/party/detail/component/PartyDetailHeaderInfo.kt`
around lines 68 - 72, In PartyDetailHeaderInfo (the composable using
partyDetail.uploadTime.toPartyUploadDate()), avoid showing just the label when
parsing fails by conditionally rendering the Text: call toPartyUploadDate() and
if it returns null either hide the entire Text composable or use the raw
uploadTime string as a fallback; specifically, replace the unconditional Text
that uses stringResource(R.string.party_detail_upload_date_label,
(partyDetail.uploadTime.toPartyUploadDate() ?: "")) with a conditional that only
emits the Text when the parsed date is non-null (or passes the original
uploadTime into the stringResource when you choose fallback).

Expand Down
1 change: 1 addition & 0 deletions app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@
</string-array>
<string name="party_detail_join_party">분철팟 참여하기</string>
<string name="party_detail_join_party_closed">마감된 분철팟이에요</string>
<string name="party_detail_upload_date_label">"%s 등록"</string>
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

문자열 리소스에 따옴표가 그대로 노출됩니다.

현재 값이 "%s 등록" 형태라 UI에 따옴표가 함께 표시될 수 있습니다. 요구사항이 따옴표 없는 표기라면 제거해주세요.

🔧 수정 제안
-    <string name="party_detail_upload_date_label">"%s 등록"</string>
+    <string name="party_detail_upload_date_label">%s 등록</string>
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
<string name="party_detail_upload_date_label">"%s 등록"</string>
<string name="party_detail_upload_date_label">%s 등록</string>
🤖 Prompt for AI Agents
In `@app/src/main/res/values/strings.xml` at line 70, The string resource
party_detail_upload_date_label currently includes literal double quotes (" %s 등록
") that will be shown in the UI; remove the surrounding quotes and use a proper
format placeholder (e.g., change the value to use %1$s 등록) so formatted text is
substituted without visible quotes, updating the string resource
party_detail_upload_date_label accordingly.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

p2: " <- 이거 들어가도 잘 뜨는건가요?(진짜모름)
스크린샷에는 안보이넹


<!-- PartyJoin -->
<string name="party_join_option_member_label">멤버</string>
Expand Down