Skip to content
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

fix :: [#106] 캘린더 버그 수정 #107

Merged
merged 3 commits into from
Oct 21, 2024
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
Expand Up @@ -30,6 +30,7 @@ public extension UIImage {
static let imageIcon = DesignSystemAsset.Image.image.image
static let checkIcon = DesignSystemAsset.Image.check.image
static let failIcon = DesignSystemAsset.Image.fail.image
static let defaultTimeTableIcon = DesignSystemAsset.Image.defaultTimeTable2.image
// MARK: TabBarIcon
static let homeIcon = DesignSystemAsset.Image.homeIcon.image
static let schoolMealIcon = DesignSystemAsset.Image.schoolMealIcon.image
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,17 +12,14 @@ import DesignSystem
public class ApplyViewController: BaseViewController<ApplyViewModel> {
private lazy var navigationBar = PiCKMainNavigationBar(view: self)

private let applyLabel = PiCKLabel(text: "신청", textColor: .modeBlack, font: .heading4)
private let applyLabel = PiCKLabel(
text: "신청",
textColor: .modeBlack,
font: .heading4
)
private let applyTabView = PiCKApplyStackView()

public override func attribute() {
super.attribute()

view.backgroundColor = .background
}
public override func configureNavgationBarLayOutSubviews() {
super.configureNavgationBarLayOutSubviews()

navigationController?.isNavigationBarHidden = true
}
public override func bind() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -132,10 +132,10 @@ public class AcademicScheduleCalneder: BaseView, FSCalendarDelegate, FSCalendarD

private func getDateEventArray() -> [Date] {
var dateArray: [Date] = []
let currentPageYear = Calendar.current.component(.year, from: calendarView.currentPage)
let currentYear = Calendar.current.component(.year, from: Date())

for date in monthAcademicScheduleData.value {
dateArray.append("\(currentPageYear)-\(date.month)-\(date.day)".toDate(type: .fullDate))
dateArray.append("\(currentYear)-\(date.month)-\(date.day)".toDate(type: .fullDate))
Comment on lines +135 to +138
Copy link

Choose a reason for hiding this comment

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

💡 Codebase verification

⚠️ Potential issue

클래스 이름 오타 수정이 필요합니다.

AcademicScheduleCalneder.swift 파일에서 클래스 이름이 AcademicScheduleCalneder로 되어 있지만, 아마도 AcademicScheduleCalendar가 맞을 것입니다. 올바른 이름으로 수정해 주세요.

🔗 Analysis chain

현재 연도 사용에 대한 논의가 필요합니다.

getDateEventArray() 메서드에서 항상 현재 연도를 사용하도록 변경되었습니다. 이는 과거나 미래의 달력을 볼 때 이벤트 표시에 영향을 줄 수 있습니다.

  1. 이 변경이 의도적인 것인지 확인해 주세요.
  2. 과거나 미래 연도의 이벤트를 어떻게 처리할 계획인지 설명해 주세요.
  3. 이 변경의 이유를 설명하는 주석을 추가하는 것이 좋겠습니다.

다음 스크립트를 실행하여 이 변경이 다른 부분에 영향을 미치지 않는지 확인해 주세요:

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: 캘린더 관련 코드에서 연도 처리 방식 확인

# Test: 연도 처리 관련 코드 검색
echo "연도 처리 관련 코드:"
rg -n "\.year" --type swift

# Test: Date 객체 생성 및 사용 검색
echo "\nDate 객체 생성 및 사용:"
rg -n "Date\(" --type swift

Length of output: 4904

}

return dateArray
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,16 +12,25 @@ import DesignSystem
public class TimeTableCollectionViewCell: BaseCollectionViewCell<TimeTableEntityElement> {
static let identifier = "TimeTableCollectionViewCell"

private let periodLabel = PiCKLabel(textColor: .modeBlack, font: .subTitle2)
private let periodLabel = PiCKLabel(
textColor: .modeBlack,
font: .subTitle2
)
private let subjectImageView = UIImageView()
private let subjectLabel = PiCKLabel(textColor: .modeBlack, font: .label1)
private let subjectLabel = PiCKLabel(
textColor: .modeBlack,
font: .label1
)

public override func adapt(model: TimeTableEntityElement) {
super.adapt(model: model)

self.periodLabel.text = "\(model.period)교시"
self.periodLabel.changePointColor(targetString: "\(model.period)", color: .main500)
self.subjectImageView.kf.setImage(with: URL(string: model.subjectImage)!)
self.subjectImageView.kf.setImage(
with: URL(string: model.subjectImage)!,
placeholder: UIImage.defaultTimeTableIcon
)
self.subjectLabel.text = model.subjectName
}

Expand Down