Skip to content

Conversation

@Yeonnies
Copy link
Contributor

🌴 작업한 브랜치

style/#189

✅ 작업한 내용

캘린더 작업 완료했습니다!

❗️PR Point

네트워크 연결할 때 아래 내려오는 뷰는 따로 작업할게요
현재 DateValueModel을 통해 캘린더 UI를 관리해주고 있습니다!

저도 잘 몰라서 유튜브 많이 참고해서 했어요.. 지적 환영합니다..
https://youtu.be/UZI2dvLoPr8?si=kl6tyj1F6QhZCzRf

📸 스크린샷

기능 스크린샷
GIF

📟 관련 이슈

@Yeonnies Yeonnies self-assigned this Jan 12, 2026
@Yeonnies Yeonnies added Style 🖼️ UI 작업 나연 🧸 나연 작업 labels Jan 12, 2026
Copy link
Contributor

@sangyup12 sangyup12 left a comment

Choose a reason for hiding this comment

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

캘린더 커스텀 수고하셨습니다! 몰랐던 캘린더 커스텀에 쓰는 함수들이 많네영. 유튜브 영상이 서티 달력이랑 비슷해서 놀랐어여. 오늘 날짜와 선택한 날짜 분기 코드 잘봤습니다~!

Comment on lines +49 to +57
Button {
withAnimation {
viewModel.currentMonth -= 1
}

} label: {
Image(.iconCalendarArrowRight)
.frame(width: 16, height: 16)
}
Copy link
Contributor

Choose a reason for hiding this comment

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

P2
ArrowRight인데 왜 currentMonth가 -1이 되지? 라고 생각이 들었는데 이미지 에셋 이름이 Left, Right 잘못된 거 같아요! 함 확인해주시오

@Published var homeStateModel = HomeStateModel()
@Published var selectedLicenseId: Int = 0
@Published var homeViewRoute: HomeViewRoute?
@Published var currentDate: Date = .distantPast
Copy link
Contributor

Choose a reason for hiding this comment

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

.distantPast 이런 게 있었다니 신기해요

Comment on lines +218 to +242
func extractDate() -> [DateValueModel] {
let calendar = Calendar.current
let currentMonth = getCurrentMonth()

let currentMonthDays = currentMonth.getAllDates().compactMap { date -> DateValueModel in
let day = calendar.component(.day, from: date)
return DateValueModel(day: day, date: date, isCurrentMonth: true)
}

var days = currentMonthDays

let firstWeekday = calendar.component(.weekday, from: currentMonthDays.first!.date)

if let prevMonth = calendar.date(byAdding: .month, value: -1, to: currentMonth) {
let prevMonthDays = prevMonth.getAllDates()
let prefixDays = prevMonthDays.suffix(firstWeekday - 1)

let prevMonthValues = prefixDays.map { date in
DateValueModel(day: calendar.component(.day, from: date), date: date, isCurrentMonth: false)
}
days.insert(contentsOf: prevMonthValues, at: 0)
}

return days
}
Copy link
Contributor

Choose a reason for hiding this comment

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

이번 달의 일과 이전 달의 일을 보여줘야할 게 있으면 합쳐서 반환하는 메서드 맞나여? 아니라면 설명 부탁슨..

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Style 🖼️ UI 작업 나연 🧸 나연 작업

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Style: 캘린더 컴포넌트

3 participants