File tree Expand file tree Collapse file tree 3 files changed +17
-14
lines changed
Expand file tree Collapse file tree 3 files changed +17
-14
lines changed Original file line number Diff line number Diff line change @@ -18,7 +18,7 @@ final class QuestViewHeader: UIStackView {
1818 // MARK: - Components
1919 private( set) lazy var titleLabel : UILabel = {
2020 let titleLabel = UILabel ( )
21- titleLabel. text = " Today Quests "
21+ titleLabel. text = " 오늘의 퀘스트 "
2222 titleLabel. textColor = . maxViolet
2323 titleLabel. font = UIFont . boldSystemFont ( ofSize: 32 )
2424
Original file line number Diff line number Diff line change @@ -94,14 +94,14 @@ final class HomeViewModel {
9494 . do ( onNext: { [ weak self] date in
9595 self ? . currentDate = date
9696 } )
97- . flatMap ( questUseCase. fetch ( by: ) )
98- . asDriver ( onErrorJustReturn: [ ] )
97+ . flatMap ( questUseCase. fetch ( by: ) )
98+ . asDriver ( onErrorJustReturn: [ ] )
9999
100- let userNotification = NotificationCenter
101- . default
102- . rx
103- . notification ( . userUpdated)
104- . map { _ in Date ( ) }
100+ let userNotification = NotificationCenter
101+ . default
102+ . rx
103+ . notification ( . userUpdated)
104+ . map { _ in Date ( ) }
105105
106106 let userData = Observable
107107 . merge (
@@ -194,13 +194,10 @@ final class HomeViewModel {
194194private extension HomeViewModel {
195195 func calculateRelative( _ date: Date ) -> String {
196196 let today = Date ( )
197-
198- if today. startOfDay > date. startOfDay {
199- return " Previous Quests "
200- } else if today. startOfDay < date. startOfDay {
201- return " Upcomming Quests "
197+ if today. startOfDay == date. startOfDay {
198+ return " 오늘의 퀘스트 "
202199 } else {
203- return " Today Quests "
200+ return " \( date . toFormatMonthDay ) 의 퀘스트 "
204201 }
205202 }
206203}
Original file line number Diff line number Diff line change @@ -19,6 +19,12 @@ extension Date {
1919 dateFormatter. dateFormat = " yyyy년 MM월 "
2020 return dateFormatter. string ( from: self )
2121 }
22+
23+ var toFormatMonthDay : String {
24+ let dateFormatter = DateFormatter ( )
25+ dateFormatter. dateFormat = " MM월 dd일 "
26+ return dateFormatter. string ( from: self )
27+ }
2228}
2329
2430extension Date {
You can’t perform that action at this time.
0 commit comments