diff options
| author | Ruben Beltran del Rio <ruben@unlimited.pizza> | 2021-02-02 09:16:46 +0100 |
|---|---|---|
| committer | Ruben Beltran del Rio <ruben@unlimited.pizza> | 2021-02-02 09:16:46 +0100 |
| commit | 1b85f723b48d38cf345bb9a4f3fd01aa6039b50b (patch) | |
| tree | b4795a83350b2bdd800e4d2749d1327c17bc385f /Map/Extensions/Date+format.swift | |
Initial commit
Diffstat (limited to 'Map/Extensions/Date+format.swift')
| -rw-r--r-- | Map/Extensions/Date+format.swift | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/Map/Extensions/Date+format.swift b/Map/Extensions/Date+format.swift new file mode 100644 index 0000000..c12e67d --- /dev/null +++ b/Map/Extensions/Date+format.swift @@ -0,0 +1,17 @@ +// +// Date+format.swift +// Map +// +// Created by Ruben Beltran del Rio on 2/1/21. +// + +import Foundation + +extension Date { + func format() -> String { + let formatter = DateFormatter() + formatter.dateStyle = .short + formatter.timeStyle = .medium + return formatter.string(from: self) + } +} |