forked from DO-NOTTO-DO/NotToDo-iOS
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
6a91a7b
commit 8f54c5e
Showing
8 changed files
with
91 additions
and
38 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
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