From 1b85f723b48d38cf345bb9a4f3fd01aa6039b50b Mon Sep 17 00:00:00 2001 From: Ruben Beltran del Rio Date: Tue, 2 Feb 2021 09:16:46 +0100 Subject: Initial commit --- Map/Extensions/Date+format.swift | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 Map/Extensions/Date+format.swift (limited to 'Map/Extensions/Date+format.swift') 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) + } +} -- cgit