-
Notifications
You must be signed in to change notification settings - Fork 0
feat: 신규 유저, 업데이트 시간 시각화 #60
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
Merged
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,31 @@ | ||
| /** | ||
| * author : 박준희 | ||
| */ | ||
| type Props = { | ||
| updateTime?: string | null; // "2025-12-24T19:00:00" | ||
| }; | ||
|
|
||
| const formatUpdateTime = (value: string) => { | ||
| const date = new Date(value); | ||
| if (isNaN(date.getTime())) { | ||
| return `${value} KST 기준`; | ||
| } | ||
|
|
||
| const yyyy = date.getFullYear(); | ||
| const mm = date.getMonth() + 1; | ||
| const dd = date.getDate(); | ||
| const hh = String(date.getHours()).padStart(2, '0'); | ||
| const mi = String(date.getMinutes()).padStart(2, '0'); | ||
|
|
||
| return `${yyyy}년 ${mm}월 ${dd}일 ${hh}:${mi} KST 기준`; | ||
| }; | ||
|
|
||
| export default function RankingUpdateTime({ updateTime }: Props) { | ||
| if (!updateTime) return null; | ||
|
|
||
| return ( | ||
| <div className="flex justify-center items-center mb-2"> | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
| <span className="text-xs text-gray-500">{formatUpdateTime(updateTime)}</span> | ||
| </div> | ||
| ); | ||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
formatUpdateTime함수에서 정규식을 사용하여 날짜 문자열을 파싱하고 있습니다. 이 방식은 날짜 형식이 조금만 바뀌어도(예: 초 단위나 타임존 정보 포함) 코드가 깨지기 쉬운 단점이 있습니다. JavaScript/TypeScript의 내장new Date()생성자를 사용하는 것이 더 안정적이고 표준적인 방법입니다.