Skip to content

Commit

Permalink
[Refactor] dateFormatter 관련 모두 수정
Browse files Browse the repository at this point in the history
  • Loading branch information
minsangKang committed Dec 2, 2022
1 parent 22a1f39 commit 4fc7cc7
Show file tree
Hide file tree
Showing 12 changed files with 20 additions and 29 deletions.
8 changes: 4 additions & 4 deletions Project_Timer.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -1502,15 +1502,15 @@
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CODE_SIGN_ENTITLEMENTS = Project_Timer/Project_Timer.entitlements;
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 1;
CURRENT_PROJECT_VERSION = 2;
DEVELOPMENT_TEAM = 2C96RNDN63;
INFOPLIST_FILE = Project_Timer/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 14.0;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
);
MARKETING_VERSION = 7.8.1;
MARKETING_VERSION = 7.8.2;
PRODUCT_BUNDLE_IDENTIFIER = com.FDEE.TiTi;
PRODUCT_NAME = TiTi;
SUPPORTS_MACCATALYST = YES;
Expand All @@ -1527,15 +1527,15 @@
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CODE_SIGN_ENTITLEMENTS = Project_Timer/Project_Timer.entitlements;
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 1;
CURRENT_PROJECT_VERSION = 2;
DEVELOPMENT_TEAM = 2C96RNDN63;
INFOPLIST_FILE = Project_Timer/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 14.0;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
);
MARKETING_VERSION = 7.8.1;
MARKETING_VERSION = 7.8.2;
PRODUCT_BUNDLE_IDENTIFIER = com.FDEE.TiTi;
PRODUCT_NAME = TiTi;
SUPPORTS_MACCATALYST = YES;
Expand Down
6 changes: 6 additions & 0 deletions Project_Timer/Global/Extension/Date+Extension.swift
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,12 @@ extension Date {
return dateFormatter.string(from: self)
}

var YYYYMMstypeString: String {
let dateFormatter = DateFormatter()
dateFormatter.dateFormat = "yyyy.MM"
return dateFormatter.string(from: self)
}

var HHmmssStyleString: String {
let dateFormatter = DateFormatter()
dateFormatter.dateFormat = "HH:mm:ss"
Expand Down
2 changes: 1 addition & 1 deletion Project_Timer/Global/Model/Dummy.swift
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ struct Dummy {
static func getDumyDays(_ stringDays: [String]) -> [Date] {
var days: [Date] = []
let formatter = DateFormatter()
formatter.dateFormat = "YYYY.MM.dd"
formatter.dateFormat = "yyyy.MM.dd"
for day in stringDays {
let tempDay: Date = formatter.date(from: day)!
days.append(tempDay)
Expand Down
2 changes: 1 addition & 1 deletion Project_Timer/Logs/Dailys/DailysVC.swift
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ extension DailysVC {
private func configureCalender() {
self.calendar.delegate = self
self.calendar.dataSource = self
self.calendar.appearance.headerDateFormat = "YYYY.MM"
self.calendar.appearance.headerDateFormat = "yyyy.MM"
self.calendar.appearance.headerTitleFont = TiTiFont.HGGGothicssiP80g(size: 25)
self.calendar.appearance.weekdayFont = TiTiFont.HGGGothicssiP80g(size: 13)
self.calendar.appearance.titleFont = TiTiFont.HGGGothicssiP60g(size: 18)
Expand Down
4 changes: 1 addition & 3 deletions Project_Timer/Logs/Dailys/Graph/StandardDailyGraphView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -247,9 +247,7 @@ extension StandardDailyGraphView {
return
}

let dateFormatter = DateFormatter()
dateFormatter.dateFormat = "YYYY.MM.dd"
self.dateLabel.text = dateFormatter.string(from: day)
self.dateLabel.text = day.YYYYMMDDstyleString
}

private func updateDayOfWeek(_ day: Date?) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -138,8 +138,6 @@ extension TasksProgressDailyGraphView {
return
}

let dateFormatter = DateFormatter()
dateFormatter.dateFormat = "YYYY.MM.dd"
self.dateLabel.text = dateFormatter.string(from: day)
self.dateLabel.text = day.YYYYMMDDstyleString
}
}
4 changes: 1 addition & 3 deletions Project_Timer/Logs/Dailys/Graph/TimelineDailyGraphView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -163,9 +163,7 @@ extension TimelineDailyGraphView {
return
}

let dateFormatter = DateFormatter()
dateFormatter.dateFormat = "YYYY.MM.dd"
self.dateLabel.text = dateFormatter.string(from: day)
self.dateLabel.text = day.YYYYMMDDstyleString
}

private func updateDayOfWeek(_ day: Date?) {
Expand Down
4 changes: 1 addition & 3 deletions Project_Timer/Logs/LogHome/SwiftUI/DailyView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -76,9 +76,7 @@ extension DailyView {
// MARK: Propertys
extension DailyView {
private var dateText: String {
let dateFormatter = DateFormatter()
dateFormatter.dateFormat = "YYYY.MM.dd"
return dateFormatter.string(from: viewModel.day.zeroDate.localDate)
return viewModel.day.zeroDate.localDate.YYYYMMDDstyleString
}

private func timeColor(time: Int) -> Color {
Expand Down
4 changes: 1 addition & 3 deletions Project_Timer/Logs/LogHome/SwiftUI/WeekView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -103,9 +103,7 @@ extension WeekView {
extension WeekView {
private var monthText: String {
guard let day = viewModel.weekDates.last else { return "0000.00" }
let dateFormatter = DateFormatter()
dateFormatter.dateFormat = "YYYY.MM"
return dateFormatter.string(from: day)
return day.YYYYMMstypeString
}

private var weekText: String {
Expand Down
5 changes: 1 addition & 4 deletions Project_Timer/Logs/ModifyRecord/ModifyRecordVC.swift
Original file line number Diff line number Diff line change
Expand Up @@ -91,10 +91,7 @@ extension ModifyRecordVC {

private func configureTitle() {
guard let day = self.viewModel?.currentDaily.day else { return }

let dateFormatter = DateFormatter()
dateFormatter.dateFormat = "YYYY.MM.dd"
self.title = dateFormatter.string(from: day)
self.title = day.YYYYMMDDstyleString
}

private func configureSaveButton() {
Expand Down
4 changes: 1 addition & 3 deletions Project_Timer/Logs/Weeks/Graph/StandardWeekGraphView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -262,9 +262,7 @@ extension StandardWeekGraphView {
return
}

let dateFormatter = DateFormatter()
dateFormatter.dateFormat = "YYYY.MM"
self.monthLabel.text = dateFormatter.string(from: day)
self.monthLabel.text = day.YYYYMMstypeString
}

private func updateWeekNumLabel(_ num: Int) {
Expand Down
2 changes: 1 addition & 1 deletion Project_Timer/Logs/Weeks/WeeksVC.swift
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ extension WeeksVC {
private func configureCalender() {
self.calendar.delegate = self
self.calendar.dataSource = self
self.calendar.appearance.headerDateFormat = "YYYY.MM"
self.calendar.appearance.headerDateFormat = "yyyy.MM"
self.calendar.appearance.headerTitleFont = TiTiFont.HGGGothicssiP80g(size: 25)
self.calendar.appearance.weekdayFont = TiTiFont.HGGGothicssiP80g(size: 13)
self.calendar.appearance.titleFont = TiTiFont.HGGGothicssiP60g(size: 18)
Expand Down

0 comments on commit 4fc7cc7

Please sign in to comment.