diff --git a/HongikYeolgong2.xcodeproj/project.pbxproj b/HongikYeolgong2.xcodeproj/project.pbxproj index eeec9dd..93fd3b5 100644 --- a/HongikYeolgong2.xcodeproj/project.pbxproj +++ b/HongikYeolgong2.xcodeproj/project.pbxproj @@ -1556,7 +1556,7 @@ "$(inherited)", "@executable_path/Frameworks", ); - MARKETING_VERSION = 1.1.1; + MARKETING_VERSION = 1.1.3; PRODUCT_BUNDLE_IDENTIFIER = com.teamHY2.HongikYeolgong2; PRODUCT_NAME = "$(TARGET_NAME)"; PROVISIONING_PROFILE_SPECIFIER = ""; @@ -1603,7 +1603,7 @@ "$(inherited)", "@executable_path/Frameworks", ); - MARKETING_VERSION = 1.1.1; + MARKETING_VERSION = 1.1.3; PRODUCT_BUNDLE_IDENTIFIER = com.teamHY2.HongikYeolgong2; PRODUCT_NAME = "$(TARGET_NAME)"; PROVISIONING_PROFILE_SPECIFIER = ""; diff --git a/HongikYeolgong2/Data/Repositories/StudySession/StudySessionRepositoryImpl.swift b/HongikYeolgong2/Data/Repositories/StudySession/StudySessionRepositoryImpl.swift index acde8ab..30e008d 100644 --- a/HongikYeolgong2/Data/Repositories/StudySession/StudySessionRepositoryImpl.swift +++ b/HongikYeolgong2/Data/Repositories/StudySession/StudySessionRepositoryImpl.swift @@ -80,7 +80,7 @@ final class StudySessionRepositoryImpl: StudySessionRepository { return Future<[AllStudyRecord], NetworkError> { promise in Task { do { - let response: BaseResponse<[CalendarCountAllResponseDTO]> = try await NetworkService.shared.request(endpoint: WeeklyEndpoint.getAllStudyRecords) + let response: BaseResponse<[CalendarCountAllResponseDTO]> = try await NetworkService.shared.request(endpoint: WeeklyEndpoint.getAllStudyRecords) promise(.success(response.data.map { $0.toEntity() })) } catch let error as NetworkError { diff --git a/HongikYeolgong2/Domain/Interactors/StudySessionInteractor.swift b/HongikYeolgong2/Domain/Interactors/StudySessionInteractor.swift index b44c34c..19f07cd 100644 --- a/HongikYeolgong2/Domain/Interactors/StudySessionInteractor.swift +++ b/HongikYeolgong2/Domain/Interactors/StudySessionInteractor.swift @@ -24,7 +24,7 @@ final class StudySessionInteractorImpl: StudySessionInteractor { private let cancleBag = CancelBag() private let studySessionRepository: StudySessionRepository private let timer = Timer.publish(every: 1.0, on: .main, in: .common).autoconnect() - private let addedTime: TimeInterval = .init(hours: 6) + private let addedTime: TimeInterval = .init(hours: 4) private var lastTime: Date? private var subscription: AnyCancellable? diff --git a/HongikYeolgong2/Domain/Mapper/CalendarMapper.swift b/HongikYeolgong2/Domain/Mapper/CalendarMapper.swift index f8ccc2a..5f3ac21 100644 --- a/HongikYeolgong2/Domain/Mapper/CalendarMapper.swift +++ b/HongikYeolgong2/Domain/Mapper/CalendarMapper.swift @@ -3,6 +3,10 @@ import Foundation extension CalendarCountAllResponseDTO { func toEntity() -> AllStudyRecord { - .init(day: date.toDayofDate(), month: date.toMonthofDate(), year: date.toYearofDate(), date: date.toDate() ?? Date.now, studyCount: studyCount) + .init(day: date.toDayofDate(), + month: date.toMonthofDate(), + year: date.toYearofDate(), + date: date.toDate() ?? Date.now, + studyCount: studyCount) } } diff --git a/HongikYeolgong2/Domain/Mapper/StudySessionMapper.swift b/HongikYeolgong2/Domain/Mapper/StudySessionMapper.swift index 66daa22..9304ac4 100644 --- a/HongikYeolgong2/Domain/Mapper/StudySessionMapper.swift +++ b/HongikYeolgong2/Domain/Mapper/StudySessionMapper.swift @@ -12,6 +12,6 @@ extension WeeklyStudySessionDTO { func toEntity() -> WeeklyStudyRecord { .init(monthOfDay: date, studyCount: studyCount, - isUpcomming: date.toDate() ?? .now <= .now) + isUpcomming: date.toDateFromMonthDay() ?? .now <= .now) } } diff --git a/HongikYeolgong2/Presentation/Record/Component/CalendarView.swift b/HongikYeolgong2/Presentation/Record/Component/CalendarView.swift index 78f2df2..50c9fd6 100644 --- a/HongikYeolgong2/Presentation/Record/Component/CalendarView.swift +++ b/HongikYeolgong2/Presentation/Record/Component/CalendarView.swift @@ -92,7 +92,7 @@ struct CaledarView: View { Spacer() } .onAppear { - calendarDataInteractor.getAllStudy(studyRecords: $AllStudy) + calendarDataInteractor.getAllStudy(studyRecords: $AllStudy) currentMonth = makeMonth(date: seletedDate, roomUsageInfo: AllStudy) } .onChange(of: AllStudy) { newAllStudy in @@ -199,7 +199,5 @@ extension CaledarView { currentMonth = makeMonth(date: seletedDate, roomUsageInfo: AllStudy) } - } - diff --git a/HongikYeolgong2/Util/Extensions/String+.swift b/HongikYeolgong2/Util/Extensions/String+.swift index 3fb1380..8847f62 100644 --- a/HongikYeolgong2/Util/Extensions/String+.swift +++ b/HongikYeolgong2/Util/Extensions/String+.swift @@ -11,16 +11,24 @@ extension String { }() /// 문자열 형식의 날짜를 Date 객체로 변환합니다. - /// - Returns: Date - func toDate() -> Date? { - let dateFormatter = Self.dateFormatter + /// - Returns: Date + func toDate() -> Date? { + let dateFormatter = Self.dateFormatter + guard let date = dateFormatter.date(from: self) else { + return nil + } + return date + } + + func toDateFromMonthDay() -> Date? { + let dateFormatter = DateFormatter() let currentYear = Calendar.current.component(.year, from: Date()) - + dateFormatter.dateFormat = "M/dd" guard let date = dateFormatter.date(from: self) else { return nil } - + var components = Calendar.current.dateComponents([.year, .month, .day], from: date) components.year = currentYear @@ -60,3 +68,5 @@ extension String { return "\(year)" } } + +