-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
26 changed files
with
270 additions
and
115 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
// | ||
// Date+.swift | ||
// NotToDo | ||
// | ||
// Created by JEONGEUN KIM on 2023/01/13. | ||
// | ||
|
||
import Foundation | ||
|
||
extension Date { | ||
func toString() -> String { | ||
let dateFormatter = DateFormatter() | ||
dateFormatter.dateFormat = "yyyy.MM.dd" | ||
dateFormatter.timeZone = TimeZone(identifier: "UTC") | ||
return dateFormatter.string(from: self) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
// | ||
// String+.swift | ||
// NotToDo | ||
// | ||
// Created by JEONGEUN KIM on 2023/01/13. | ||
// | ||
|
||
import Foundation | ||
|
||
extension String { | ||
|
||
func toDate() -> Date? { | ||
let dateFormatter = DateFormatter() | ||
dateFormatter.dateFormat = "yyyy.MM.dd" | ||
dateFormatter.timeZone = TimeZone(identifier: "UTC") | ||
if let date = dateFormatter.date(from: self) { | ||
return date | ||
} else { | ||
return nil | ||
} | ||
} | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
29 changes: 29 additions & 0 deletions
29
NotToDo/NotToDo/Network/DataModel/Achieve/AchieveCalendarResponseDTO.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
// | ||
// AchieveCalendarResponse.swift | ||
// NotToDo | ||
// | ||
// Created by JEONGEUN KIM on 2023/01/13. | ||
// | ||
|
||
import Foundation | ||
|
||
struct AchieveCalendarResponseDTO: Codable { | ||
let actionDate: String | ||
let count: Int | ||
|
||
func toDate(dateString: String) -> Date? { | ||
let dateFormatter = DateFormatter() | ||
dateFormatter.dateFormat = "yyyy.MM.dd" | ||
dateFormatter.timeZone = TimeZone(identifier: "UTC") | ||
if let date = dateFormatter.date(from: dateString) { | ||
return date | ||
} else { | ||
return nil | ||
} | ||
} | ||
|
||
func convert() -> [Date: Int] { | ||
guard let date = self.toDate(dateString: actionDate) else { return [:]} | ||
return [date: count] | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.